0

in regards to this post of mine Clean up Active Directory I was trying to run the command

dsquery Computer -inactive 52 | DSMOVE -newparent OU=Test,OU=Devices,DC=domain,DC=com,DC=au

When I run this command i get the following error message

dsmove failed:'CN=Computer1,OU=Staff PCs,OU=Devices,DC=domain,DC=com,DC=au' is an unknown parameter.

Any ideas what this means? when i remove the device in question from AD then it simply errors on computer2 in the same manner. Have i got the syntax wrong?

JohnyV
  • 938
  • 4
  • 26
  • 45

2 Answers2

0

Interesting. I'm seeing the same behavior. Directly putting the entry into the right side of the pipe works, but using it to string commands together does not. You might try working around this using a for loop; this worked for me, anyway:

for /f %f in ('dsquery computer -inactive %yourcount') do dsmove %f -newparent %yourparent

-Mary

Mary
  • 1
  • Sorry could you explain your statement above there are some variables that i am not familiar with.Thanks for your response. – JohnyV Feb 08 '11 at 04:02
  • Mmm. The %yourcount corresponds to 52 in your example. %yourparent corresponds to the test ou from your example. Or are you referring to the for loop? for /? for usage. – RobW Feb 10 '11 at 21:36
0

My piped dsmove commands work (where both yours and Mary's did not), but with one restriction - I have to be able to use dsquery to see the target OU. If dsquery can not see the target ou, and I try to move something into it, I receive this (backward?) error:

dsmove failed:<object I am trying to move>:Directory object not found.

Issue the command:

DSQuery.exe ou -name *test*

(or whatever OU you're trying to move to). Do you get a proper DN? Or no returned data?

Re-issue the dsquery ou command and search for another OU. Can you move the object to that OU?

The difference for me is the class type - OU=Computers (which in ADUC looks nearly like any other OU) is of a class "container" and my dsmove fails. The OU to which my dsmove succeeds is of a class "organizational unit".

If I right click the OU and selecting the object tab from within ADUC, I can see that it is Container or Organizational Unit.

What do you think? Are you trying to move to a class "container" OU?

RobW
  • 2,766
  • 1
  • 17
  • 22
  • I revisited this and still having the same issues. – JohnyV Apr 27 '11 at 23:04
  • JohnV, If you right click the OU to which you are copying the object, select properties, and click the object tab, is it a 'container' class or 'organization unit' class? – RobW Apr 28 '11 at 00:51