Re: dsquery pipe to dsmove
There seems to be some problem in your dsquery. The proper context for dsmove is as follows:
dsmove.exe "CN=%1,OU=aaa,DC=AA,DC=BB,DC=com" -newparent
OU=bbb,DC=AA,dc=BB,dc=com
Re: dsquery pipe to dsmove
Hello HenrikK. You need to add a space before the redirection. Which should be like this:
dsquery computer cn=computers,dc=na,dc=zzz,dc=com -name xxxtest* |dsmove
-newparent "ou=usa,ou=il,ou=southside,ou=computers,dc=na,dc=zzz,dc=com"
Hope it helps. let me know the results.
Re: dsquery pipe to dsmove
so here's the problem. When DSQUERY pipes the output to DSMOVE, it is failing to put the DN of the found object in quotes.
that's why you get an error
dsmove failed:`CN=Tom Jones,OU=Blah,OU=ManagedUsers,DC=teach,DC=foo,DC=bar' is an unknown parameter.
it should be sending "CN=Tom Jones,OU=Blah,OU=ManagedUsers,DC=teach,DC=foo
t,DC=bar"
The best way I've found to do this same iteration is, as others have suggested, by reversing it. Call DSMOVE and pull in the DSquery with a for command
for /f "Tokens=*" %s in ('dsquery computer -limit 1 cn=computers,DC=vprodemo') do dsmove %s -newparent ou=validation,dc=vprodemo
http://www.tech-archive.net/Archive/.../msg00568.html