I am looking for a script to move computers from one ou to another based on their operating system
I tried the followings
1- dsquery * CN=Computers,ou=test1,DC=mypc,DC=com -filter "(&(ObjectClass=computer)(objectCategory=Computer)(operatingSystemVersion=5.1))" | dsmove -newparent OU=test2,DC=mypc,DC=com
I got the following error
dsquery failed:Directory object not found.
type dsquery /? for help.dsmove failed:'Target object for this command' is missing.
type dsmove /? for help.
2-dsquery * ou=test1,DC=mypc,DC=com -filter "(&(ObjectClass=computer)(objectCategory=Computer)(operatingSystemVersion=5.1))" | dsmove -newparent OU=test2,DC=mypc,DC=com
I got the following error
dsmove failed:'Target object for this command' is missing.
type dsmove /? for help.
anybody can help me on this please