Account Automation | create multiple user accounts in active directory

User Accounts in active directory:

Creating user accounts in active directory is very simple, open active directory user and groups from administrative tools.

  • Right click in default user container and on OU, click on new and then user.

User Accounts in active directory

  • Fill the first name and last name and user name for login and click next.
  • Set the password for user account and other password related setting.
  • Click on finish.

Create multiple user accounts in active directory:

Being a network administrator we daily deal with user accounts, sometimes we have to create multiple accounts in very short times for example in university or college when a new semester is starts and hundreds of students got admission. In such case it is very difficult to create the user account one by one. There are some account automation methods using these methods you can create large number of accounts in no time. These account automation methods are as follow:

User Accounts Templates in Active directory:

User account template is also an easily and fast way of creating multiple accounts with similar group policy. Suppose you have 100 new students in college and you want to create all students’ user accounts with following characteristics

  1. All students user accounts  should be member of student group
  2. All student only logon from 8 AM to 8 PM
  3. And all these account will expire after 1 year

With user account templates in AD create 100 students account with above condition is little easy. First you create a template user account with any name let say student and set the above all condition for student account.

How to create accounts from template:

Once you create this account right click on student account and click on copy and new user account dialog is appear you just enter the user name and password for  this new account. This new user will have all the characteristics as student template account. In this way you can create multiple student account.

Create user accounts with LDIFDE:

Using LDIFDE command you can create users from a .ldf file. Below is code of a simple .ldf file called a.ldf.

 

dn: CN=viki,CN=Users,DC=w7cloud,dc=com

objectclass: User

SamAccountName: viki

UserAccountControl: 514

UserPrincipalName: [email protected]

 

Where “viki” is the user that we want to create, CN=Users is specify the container where this new user should go and w7cloud is domain name. In active directory to create a user with this LDF file open the command prompt  and type the following commad.

 


ldifde -i -f "c:a.ldf" -j c:

 

-j c; is for error log if you some error in file code.

Create user accounts with LDIFDE:

You can add the codes for multiple users in LDF file and can run this file using same above commad

 

Server Core Commands

 

Create user accounts with CSVDE:

You can create the user account in active directory with CSVDE command in same way as with LDIFDE, but in this case you need a .CSV files which containing the users. You can use the following command for importing users from users.CSV file into active directory.


ldifde -i -f "c:users.csv"

 

Create user accounts with DSADD:

DSADD is the primary tool for creating user accounts, you can easily create a bunch of user using DSADD command, but here I only mention how to create a single user with this command. i.e.


Dsadd user cn- HRuser1,ou=HR, DC-w7cloud,DC-com

 

Waqas Azam
Me Waqas Azam and I am a professional blogger & freelance writer. I also working in the IT industry for over 7 years. I am graduated in Computer Science and information technology.