For Programmers: Free Programming Magazines  


Home > Archive > Windows Server Scripting > April 2004 > dsquery | dsmod









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author dsquery | dsmod
Alpha21

2004-03-31, 4:30 pm

All,

When I pipe a dsquery to a dsmod to move old computer accounts, I get the following error:
COMMAND:
C:\WINDOWS\system32>dsquery computer domainroot -scope subtree -stalepwd 60 -lim
it 5000 -q | dsmove -newparent " OU=disabledmachineaccounts,DC=mcpsmd,DC=
org"
OUTPUT:
dsmove failed:`CN=BIDWCOGNOS4,OU=servers,DC=mcp
smd,DC=org' is an
unknown parameter.

The dsquery returns plenty of objects when used without the dsmove, and the dsmove works when I specify a single object, so I am not sure why the two together will not work.

Thanks for any help.

Baron Tancred

2004-04-28, 8:30 am

Hi Alpha,

I`m suffering the same problem. It`s seems as though multiple results from dsquery are passed to dsmove inside single quotes, which dsmove can`t cope with.

Not a bug, surely. :-o

You can get round it by piping the dsquery results to a file, and using FOR to go through the file.
e.g.

C:\>dsquery computer "cn=computers,dc=domainname,dc=net" -name exw-* >movepcs.txt
C:\>for /f %i in (movepcs.txt) do dsmove %i -newparent "ou=newOU,dc=domainname,dc=net"

Does anyone have a way to make the dsquery..|dsmove.. method work properly?

----- Alpha21 wrote: -----

All,

When I pipe a dsquery to a dsmod to move old computer accounts, I get the following error:
COMMAND:
C:\WINDOWS\system32>dsquery computer domainroot -scope subtree -stalepwd 60 -lim
it 5000 -q | dsmove -newparent " OU=disabledmachineaccounts,DC=mcpsmd,DC=
org"
OUTPUT:
dsmove failed:`CN=BIDWCOGNOS4,OU=servers,DC=mcp
smd,DC=org' is an
unknown parameter.

The dsquery returns plenty of objects when used without the dsmove, and the dsmove works when I specify a single object, so I am not sure why the two together will not work.

Thanks for any help.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com