Avatar of mlptechsupport
mlptechsupport
 asked on

how do i use dsmove with piped results

i am trying to use the dsquery command line tool to identify inactive computer accounts of 8 weeks and then dsmove them by piping the results.

 The command is:
dsquery computer -inactive 8 -limit 1000 ou=mlp,ou="computer accounts",dc=aaa,dc=bbb,dc=ccc,dc=org   | dsmove -newparent ou="inactive computers",ou=mlp,ou="computer accounts",dc=aaa,dc=bbb,dc=ccc,dc=org -u domain\userid -p Mypassw0rd

The error returned is:
dsmove failed:`CN=sporaticcomputernames,OU=MLP,OU=computer accounts,DC=aaa,DC=bbb,DC=ccc,
DC=org' is an unknown parameter.
type dsmove /? for help.
Microsoft Legacy OSMicrosoft Server OSWindows Server 2003

Avatar of undefined
Last Comment
mlptechsupport

8/22/2022 - Mon
Farhan Kazi

This may be due to incorrect OU DN format.
It should be like:

dsquery computer -inactive 8 -limit 1000 "ou=mlp,ou=computer accounts,dc=aaa, dc=bbb,dc=ccc, dc=org" |dsmove -newparent "ou=inactive computers,ou=mlp,ou=computer accounts,dc=aaa,dc=bbb,dc=ccc,dc=org" -u domain\userid -p Mypassw0rd

Open in new window

ASKER CERTIFIED SOLUTION
oBdA

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mlptechsupport

ASKER
It worked beautiffully! Thank you!
I did however get an Out of Memory Error and explorer closed. The script finished and move the objects, but I had to manually run an explorer task.
Your help has saved me hundreds of hours of internet surfing.
fblack61