DSADD Assistance

CaryH128 used Ask the Experts™
Good afternoon. I have probably an easy question. Say I have a domain called Test.com

I also have another domain called Corp.Test.com

I need to quickly add a list of computers to both of those OU's in AD.  Am I on point by thinking I can use DSADD to accomplish this?  If so, can you give an example of the script that needs to add computers to these two OU's?

Example.  I need to have Computer-1, Computer-2, and so forth.  There are about 250 of these computer names. I have the list in an xls spreadsheet.  I can quickly add the command on the list, copy the list to a txt document, and then run it in the command prompt.

Can someone provide the command line data to accomplish this?  

Thank you.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Here's an example:

dsadd computer "cn=Computer-1,ou=Computers,dc=corp,dc=test,dc=com"
The example above is assuming you have an OU named computers.


Okay... thank you... one more quick question.... how can I add it to an OU of the domain.  For example,  In the corp.test.com domain, the compute OU is called LOCATION, then under that, Workstation.

This way the computer goes to the correct OU under the corp.test.com domain.  

(I hope that makes sense)

actual location needs to be
Like so:

dsadd computer "cn=Computer-1,ou=workstation,ou=location,dc=corp,dc=test,dc=com"

Just think more specific location is furthest to the left of the distinguished name (DN).


Sorry to bug you... one of the OU's has a space in the name.... example:
here is the pc I'm trying to import: domain.com/texas/Dev PCs/TestPC-1d

I used the following:
dsadd computer "cn=TestPC=1d,ou=texas,ou=Dev PCs,dc=domain,dc=com

I get the following message:
dsadd failed:cn=TestPC=1d,ou=texas,ou=Dev PCs,dc=domain,dc=com A referral was returned from the server.

Any ideas what I'm doing wrong?
Cool, another Texan.

Use quotes for your DN.

dsadd computer "cn=TestPC-1d,ou=texas,ou=Dev PCs,dc=domain,dc=com"


I'm sorry, I didn't put the end quote on my example, but I did in the actual command prompt.  Still gave me that error.  I'm changing the actual names... i'll just use generics:

dsadd computer "cn=ADDTEST-1D,ou=name1 PCs,ou=division,dc=domain,dc=com"

This is exactly how I typed it in on the CMD line. I changed the OU for security purposes to name1 PC's and division, and domain.   I changed those for security.  But besides changing the name, that's exactly how I typed it in on the command line.
Just to verify you have this OU structure

-> Division
  -> PCs
    -> Name1

So you have an OU called Name1 under PCs which is under Division, right?


I have

       -Dev PCs

The computer needs to go in the DEV PC's folder  I think the problem may be the space in the name of the "Dev PCs" OU

I'm sorry if I'm not being clear.  and I REALLY appreciate your help.  Trying to add all the PC's that need to be added manually will take a LONG time.
You should be able to substitute the computer name for yours and it should work:

dsadd computer "cn=testcomputer,ou=dev pcs,ou=division,dc=domain,dc=com"


Thank you so very much!  I really appreciate all of your assistance.
No problem. You're welcome.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial