DSadd a New Way to Create Users in Windows 2003

Introduction to DSadd

DSadd is the most important member of this DS scripting family.  The primary use of DSadd is to quickly add user accounts to Windows Server 2003 Active Directory.  However, you can also use this method to create OUs computers, groups, or even contacts.

Creating an OU – DSadd ou….

Let us create an OU (organizational unit) to hold the rest of the test objects.  Edit the dc=cp and dc =com to the fully qualified name of your Windows 2003 domain.  As ever, pay close attention to the syntax, for instance the DN "ou=guyds, dc=cp, dc=com"  is enclosed in double speech marks.  Single ‘speech marks’ will not work.  Also remember that DS is new in Window 2003, so will not work in Windows 2000.

Example 1 Using DSadd to Create an Organizational Unit in Windows 2003

Preparation:

Logon to your domain controller.

Examine the script below.  Edit ou= or dc= to reflect YOUR domain.

Run, CMD then copy your script and paste into the command window.  Alternatively type it starting with dsadd ou ………

dsadd ou "ou=guyds, dc=cp, dc=com"
 

Note 1: dsadd ou.  This command tells Active Directory which object to create, in this case an OU (not a user).

Note 2: You only really need speech marks if there is a space in any of your names. So ou=guyds, dc=cp, dc=com would work fine, but ou=GUY Space DS, dc=cp, dc=com fails because of the spaces in the GUY Space DS, name.  In this second example you would type: "ou=GUY Space DS, dc=cp, dc=com"

°

Example 2 Employing DSadd to Create a User. (Assumes you have completed Example 1)

The purpose of this example is to create a new user in an OU called guyds.

Preparation:

Logon to your domain controller. 

Examine the script below.  Decide if cn= or ou= or dc= need editing.

Run, CMD then copy your script and paste into the command window.  Alternatively type it starting with dsadd user ………

Creating a User – DSadd user….

dsadd user "cn=guyt, ou=guyds, dc=cp, dc=com"
 

Note: DSadd requires the complete distinguished name.  Note also that the distinguished name is encased in double "speech marks".   I expect you spotted that the user will be created in the guyds organizational unit that was created in the first example.  Change "cn=guyt to a different user name if you wish.

Guy Recommends:  SolarWinds’ Free Bulk Import ToolFree Download Solarwinds Bulk Import Tool

Import users from a spreadsheet.  Just provide a list of the users with their fields in the top row, and save as .csv file.  Then launch this FREE utility and match your fields with AD’s attributes, click and import the users.

Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool.

If you need more comprehensive software, download a free trial of SAM (Server & Application Monitor)

DS Error Messages

DS has its own family of error messages.  I found that they are specific and varied, just remember to pay attention to detail.  READ ERROR MESSAGES SLOWLY.


See Also