• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2321
  • Last Modified:

NETDOM question - join machine to OU

I'm attempting to join a PC to a domain and OU, but I;m not having any luck:

netdom.exe add %computername% /Domain:AD /UserD:MYID /PasswordD:********* OU/:ou=Computers,ou=My Branch,ou=Unit,dc=ad,dc=company,dc=com

I keep on getting the error:
 The parameter OU/:ou=Computers,ou=My was unexpected.
 The parameter is incorrect.

If I use quotes around the OU name, I get:
 The parameter OU/:ou=Computers,ou=My Branch,ou=Unit,dc=AD,dc=Company,
c=Com was unexpected.
 The parameter is incorrect.

How can I get this to work???
1 Solution
Marketing_InsistsAuthor Commented:
any commandline method would be great.  VB or whatever
Just in case, as it's appearing three times: it should be /ou:"some OU", not OU/:.
netdom.exe add %computername% /Domain:AD /UserD:MYID /PasswordD:********* /OU:"ou=Computers,ou=My Branch,ou=Unit,dc=ad,dc=company,dc=com"
Note that if you specify a OU, you have to run the netdom command on the DC itself, you can't run it from a client.
Maybe of help:
Automating the Creation of Computer Accounts
What happens when you use \ instead of /   ?
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

If the LDAP connector in netdom.exe uses SQL commands you might have to use single quotes ‘ instead of the ordinary double quotes “
Marketing_InsistsAuthor Commented:
got errors when I used \ instead of /  

Bummer if I can only run this command on a DC, (no login rights)  Maybe I can get.
What you could try instead (assuming you have the permissions to do so) is to create the account in the standard OU, then use dsmove.exe (part of the W2k3 adminpak.msi) to move it into the target OU.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now