Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
DSQUERY user -inactive 4 | DSMOVE -newparent <distinguished name of target OU>

Running this script and getting "dsmove failed (user) is an unknown parameter".

If I run the dsquery w/o the dsmove, it cleanly pulls a list for me. If I run with just one account, it works as well.


share|improve this question
up vote 3 down vote accepted

Got this working, here's what I did:

batch file that reads the below with a correlating windows sch task that runs the bat. Works like a champ.

Remember in 2008 to check the "run with highest privileges" and to change the run to "run whether user is logged on or not".

for /f "Tokens=*" %%s in ('dsquery computer -inactive 5 -limit 0') do ( 
DSMOVE %%s -newparent "OU=Computers,OU=Quarantine,OU=MyOu,DC=MyDomain,DC=local" 
share|improve this answer
Would be nice if Microsoft fixed this. – Nixphoe Jul 9 '12 at 19:10
thanks that solved this problem for me however it only worked when I did it without the brackets around the DO action. for /f "Tokens=*" %%s in ('dsquery computer -inactive 8 -limit 1000') do DSMOVE %%s -newparent "OU=DisabledComputers,DC=DomainName,DC=local" – Arturski May 30 '13 at 12:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.