This is the complete tutorial to creating bulk users in Active Directory.
Yes, I know
Creating Active Directory accounts is boring, it can be repetitive and time consuming when done manually.
And who has the time to manually create bulk AD accounts?
Well, I’ve got good news!
Importing bulk ad users is simple and can actually be fun. (Yea I’m a nerd, automation is a great thing).
In this guide, I’ll show you step by step instructions on how easy it is to create bulk ad accounts.
I’m actually going to show you two methods
Check it out
If you don’t like video tutorials or want more details, then continue reading the instructions below.
Method 1: Using PowerShell to import ad users from a csv
If you don’t like PowerShell or want a GUI import tool then jump to method 2.
What you will need:
- PowerShell Active Directory Module loaded – The script I provide will load the module you just need to run it from a computer that has RSAT tools installed or the AD role.
- Rights to create users accounts in Active Directory
- CSV file and PowerShell Script -> Download Here
Step 1: Setup the csv file
There are only 5 fields in the csv file that are required for each user account, they are:
I will walk through adding a few users to my csv file
Above is a screenshot of my csv file setup with the required fields configured. It’s not a good security practice to set the same password for every account, mix it up some.
I’ve set the PowerShell script to set the accounts to require password change at next logon, another good security practice. This can be changed if you want to remove that option.
You can set each account to import into a specific OU. I’ve set two accounts to import into the default users OU then I set one account to import into a Marketing OU.
How do you find the OU path?
The OU path is the distinguishedName attribute, to find this open up Active Directory Users and Computers and browse to the OU you want to import to, then right click and select properties then select attribute editor.
Copy the path into the OU column on the csv file.
At this point the csv file has the required fields, you can jump to step 2 (setting up the PowerShell script) or keep reading to setup optional fields for user accounts.
Setup User Optional fields
You may want to include some additional details for each account.
I’ve included some optional fields that are commonly used when setting up AD accounts. If there are fields you want to add that I have not provided, just add them to the csv file (you will also need to add it to the script)
As you can see in the screenshot above I’ve entered info into the optional fields for 2 accounts.
Now save the csv file to an easy to remember location. I’ve put mine in c:\it\Final_NewAccounts2.csv
The path of the csv file will need to be entered into the powershell script. With the csv file setup I’ll move to step 2.
Step 2: Setup the PowerShell script
The only thing that needs to be modified in the script is the path to the csv file, and the UserPrincableName.
To modify the script just right click on the ps1 file and select edit. This will open the script in PowerShell ISE
Modify this section to the correct path of your csv file.
$ADUsers = Import-csv C:\it\Final_NewAccounts2.csv
Now modify line 42 and change the domain
My domain is ad.activedirectorypro.com so I will update mine to
Save the changes and move on to step 3.
Step 3: Run the PowerShell Script to import the accounts
At this point, the csv file should be setup with the users information and the Powershell script should be modified.
Now it’s time to execute the script.
In PowerShell ISE just click the green button to run the script.
It should return to the prompt if it ran successfully, I received a warning due to an account that already exists.
I will verify it created the other account.
Yes it was a success.
That’s it for method 1. You can now use this script anytime to automate creating one or many AD user accounts. It’s a huge time saver.
Method 2: Using GUI Tool to bulk import AD users
This method requires no PowerShell. It’s super easy and has built-in support for many user attributes, adding to multiple groups, multiple proxyaddresses, and so on.
What you will need:
- AD Pro Toolkit. -> Click here to download a free trial
- Rights to create user accounts in Active Directory
Step 1: Download and Install the AD Pro Toolkit
The install is very simple:
1. Extract the downloaded zip file and run the installer file -> AD Pro Toolkit Demo Installer.msi
2. Click next on the Welcome screen
3. Choose destination path (default is fine) click next
5. Click Next
6. Click Close
Install finished! You will find the Bulk User Creation tool in the Start Menu.
Step 2. Bulk User Creation Tool CSV Setup
The next step is to generate the CSV template and fill out the user details.
Open the tool and click on generate CSV template
You will be prompted to save the CSV template. You can change the name and save it anywhere you like.
Now open the CSV template and fill out the fields you need.
- The only required field is the sAMAccountName, the rest are optional.
- Don’t delete columns, if you don’t need one just leave the row blank for the user.
- The template includes 33 user attributes. You can add additional attributes by adding a new column with the attribute name.
- Use the ou column to add users to an organizational unit. This needs to be the DN of the OU. I provided steps above for finding this value.
- You can add users to multiple groups by separating them with a comma. Example below in my CSV screenshot.
- You can give users multiple proxyaddresses just separate them with a comma.
In this example, I’m going to create several users and add them to multiple security groups.
When you have your CSV template ready just save it and move to step 3.
Step 3. Select CSV and run the import.
The next step is to select the template from the GUI tool and click run.
You will see the progress in the lower left. In addition, you will see the process in the log box, it will show any errors in red and all properties that were set in green.
All 39 users I set in the CSV completed. Now, I’ll go into Active Directory users and computers and verify some of the settings.
Looks like the users were added to the organizational units.
Now lets check if the user was added to the security groups.
Yes! It worked, it created the account and imported all the fields I set.
The GUI tool makes the bulk importing process very very easy, no coding or PowerShell experience is needed.
I have shown you two methods for creating bulk users in Active Directory, try them out and decide which one works best for you.
You Might Also Like…
Recommended Tool: SolarWinds Server & Application Monitor
This utility was designed to Monitor Active Directory and other critical services like DNS & DHCP. It will quickly spot domain controller issues, prevent replication failures, track failed logon attempts and much more.
What I like best about SAM is it’s easy to use dashboard and alerting features. It also has the ability to monitor virtual machines and storage.