Windows Server

Perform Bulk Active Directory Operations Using Dsadd On Server 2016

Dsadd is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsadd, you must run the dsadd command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

  • Dsadd computer
  • Dsadd contact
  • Dsadd group
  • Dsadd OU
  • Dsadd user
  • Dsadd quota

Before Going Further keep in Mind, If there is Something you have noticed in this article, let me know in the comments. Also, tell us your needed Article so we have to create that.

Perform Bulk Active Directory Operations Using Dsadd

Creating Users Using Excel

The method of creating multiple users with dsadd is that first, we need to create a list of users then when we create a list of the users, we will save that as a .bat file which is a script format.

The very hard part of Using the Dsadd command is creating a list of Users. You can create a list of the users in a text editor, but I recommend you to use Microsoft Excel because we are only creating 1 user and then we will auto fill as many users as you need.

Step 1: To Create the first user, first open Microsoft Excel, then type down these headings.

Note: If you search for Dsadd User /? On CMD, you will see the syntaxes. You can type any of those syntaxes which you need as a heading. I have used just five of them.

Step 2: Type the first user name. I have typed Techuser01.

Perform Bulk Active Directory Operations Using Dsadd
Heading and User

Step 3. Now we need to fill up the Dsadd Statement. To fill it I will use the CONCATENATE function.

  1. Type =Concatenate
  2. After that type =Concatenate(“Dsadd User cn=,OU=Tech,DC=Techroze,DC=com”)
Perform Bulk Active Directory Operations Using Dsadd
Dsadd Statement

Step 4. In order to create a User Principle Name(UPN), once again I’m using the CONCATENATE Function.

  1. Type =Concatenate
  2. After that type =CONCATENATE(” -upn “,A2,”@techroze.com“)

Note: A2 is the user which is located on the column of A and on Row 2, which will be called A2. @Techroze.com is the Server Domain.

Perform Bulk Active Directory Operations Using Dsadd
UPN

Step 5. It is time to fill the Display name. To fill it again I will use the =CONCATENATE Function.

  1. Type =CONCATENATE
  2. After that type =CONCATENATE(” -Display “,A2)

Step 6. To fill password, follow these steps.

  1. Type =CONCATENATE
  2. Then type the –pwd and a password which will look like this. =CONCATENATE(” -pwd Ali123!@# “)

Note: Don’t worry about the Password because we user will change the password while login.

Perform Bulk Active Directory Operations Using Dsadd
Password

Step 7. In order to make sure that the user must change the password while login again we will use the CONCATENATE Function. Here are the procedures:

  1. Type =CONCATENATE
  2. Then type =CONCATENATE(” -MustchPwd Yes”)
Perform Bulk Active Directory Operations Using Dsadd
User Must Change Password

Step 8. Now that you have created the first user, I need 49 more users, so I will select the first user with complete info (User, dsadd statement, upn, display, pwd, mustchpwd), then I will simply drag that down to autofill the users.

Perform Bulk Active Directory Operations Using Dsadd
Select and drag

Step 9. Now that you have 50 users, we need to combine each user one by one into one cell in order to create that as a script.

  1. Scroll down or create a new sheet.
  2. Type =CONCATENATE(B2,C2,D2,E2,F2)

Note: Once you combined one of them, again select that use the auto fill magic.

 

Step 10. I have just copied those fifty users and pasted in notepad and at the end, I have just Added Pause because I want to see if there was a problem with the code I have to see that.

Perform Bulk Active Directory Operations Using Dsadd
Pause

Step 11: Now move to file menu and select save as, then give a name, at the end just add the .bat extension.

Perform Bulk Active Directory Operations Using Dsadd
Save as .bat file

Perform Bulk Active Directory

Step 1: Now create an OU from Active Directory Users and Computers which you have specified above at step 3. After that right click on the script and select Run as Administrator.

Perform Bulk Active Directory Operations Using Dsadd
Run script as Admin

Step 2: Now command prompt will open and wait until the process completes. See on the screenshot all the 50 users which are created.

Perform Bulk Active Directory Operations Using Dsadd
Bulk Process

Here are the Users which have been created in the Active Directory.

Perform Bulk Active Directory Operations Using Dsadd
Created Users list

That’s all, I hope this article helped you with Perform Bulk Active Directory Operations Using Dsadd on Server 2016? If you liked this article, share it with ot

Don’t forget to subscribe to our YouTube Channel for WordPress, Server, Business, and Technology video tutorials. You can also find us on Twitter and Facebook.

Related posts

Migrating Roles from Server 2012R2 to Windows Server 2016

BISMO

Install & Configure Remote Desktop Services on Server 2016

BISMO

Manage Active Directory Users & Computers Using PowerShell

BISMO

Leave a Comment