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.

Thoughts?

link|improve this question

feedback

1 Answer

up vote 0 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" 
) 
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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