We help IT Professionals succeed at work.

how do i use dsmove with piped results

843 Views
Last Modified: 2010-04-21
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.
Comment
Watch Question

Farhan KaziSystems Engineer
CERTIFIED EXPERT
Top Expert 2007

Commented:
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

CERTIFIED EXPERT
Most Valuable Expert 2019
Most Valuable Expert 2018
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.