Donald Barker
asked on
Problems with DSQUERY | DSMOVE command
I am attempting to move disabled users from one ou to another using the following command and I keep getting an error.
dsquery user -disabled "ou=contractors,dc=company ,dc=corp,d c=local" | dsmove -newparent "ou-disabled contractors,dc=company,dc= corp,dc=lo cal"
dsmove failed:`CN=Smith\, John,OU=Contractors,DC=COM PANY,DC=Co rp,DC=Loca l' is an unknown parameter.
It seems that dsmove is reading the "\" as a backslash instead of using it as an escape character. as required according to dsmove help.
Can someone explain to me how to correct this problem, or perhaps a better way of performing this task?
dsquery user -disabled "ou=contractors,dc=company
dsmove failed:`CN=Smith\, John,OU=Contractors,DC=COM
It seems that dsmove is reading the "\" as a backslash instead of using it as an escape character. as required according to dsmove help.
Can someone explain to me how to correct this problem, or perhaps a better way of performing this task?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks oBda, very helpful.
Click Start -> Run -> Cmd.exe -> OK
FOR /F "delims=*" %u IN ('DSQuery User -disabled "ou=contractors,dc=company
Hope this helps!
Farhan