Link to home
Start Free TrialLog in
Avatar of Daltonjoe
Daltonjoe

asked on

dsquery | dsrm what´s wrong with my syntax

When I try to run my below syntax I get this error:
"Are you sure you wish to delete all children of OU=Desktops,OU=Workstations,OU=045HO,OU=Locations,DC
=velux,DC=org (Y/N)? dsrm failed:OU=Desktops,OU=Workstations,OU=045HO,OU=Locations,DC=velux,DC=org:T
he handle is invalid."
dsquery computer OU=Desktops,OU=Workstations,OU=045HO,OU=Locations,DC=velux,DC=org -inactive 50 -limit 0 | dsrm "OU=Desktops,OU=Workstations,OU=045HO,OU=Locations,DC=velux,DC=org" -subtree -exclude -c

Open in new window

Avatar of Toni Uranjek
Toni Uranjek
Flag of Slovenia image

Hi!

Use only "dsquery computer OU=Desktops,OU=Workstations,OU=045HO,OU=Locations,DC=velux,DC=org -inactive 50 -limit 0 | dsrm" if you are trying to delete old computer accounts. Your dsrm part of command is trying to delete an OU.

HTH

Toni
Avatar of Daltonjoe
Daltonjoe

ASKER

Hi Toniur
 
Thanks for your comment.
How can I then combine my dsquery with a "auto " deletion of in thsi example computers?
ASKER CERTIFIED SOLUTION
Avatar of Toni Uranjek
Toni Uranjek
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial