Import Users Into Active Directory
In this tutorial, you will learn how to import users into Active Directory. In this guide, I’ll demonstrate using the Active Directory User Creation Tool that is included with the AD Pro Toolkit.
In this example, I’m going to import 100 users, add the users to multiple security groups, add a manager for each user, and set 30 other user fields.
Table of Contents:
- Read First
- Step 1. Download CSV Template
- Step 2. Modify the CSV Template
- Step 3. Select Import option
- Step 4. Verify Import (optional)
- CSV Template CheatSheet
- Add Additional User Fields to the CSV
- It is recommended to first run a small import to ensure the accounts are being created as expected.
- The CSV template includes 33 user attributes. This covers the most common attributes for creating new accounts. Additional attributes can be added to the template.
- You DO NOT need to add the name attribute to the CSV. This gets automatically created based on the first and last name.
- CSV Template – Refer to the provided CSV template for an example of how to setup the CSV file.
- CSV Template CheatSheet – If you are not familiar with Active Directory attributes then refer to the CSV Template Cheatsheet section for an overview.
Step 1: Download CSV Template
1. Click on Import Users
2. Click on the CSV Template button
You will be prompted to save the CSV file. You can save it anywhere you want.
Step 2. Modify the CSV Template
The provided template includes an example user as a reference on how to fill out the CSV template.
Tip: See the CSV Template CheatSheet section if you are not familiar with Active Directory Attributes.
At a minimum, I recommend setting the following fields for all users.
- SamAccountName (required) = This will be the users logon name.
- password (required) = users password. Make sure it meets your password requirements.
- OU = The organizational unit to import users into. This is the distinguished name of the OU. If you leave it blank it will import into the default users container.
- GivenName (required) = First name
- Surname (required) = Last name
- DisplayName = Display Name
- Groups = Groups to add the users to. Separate each group with a comma.
You can download my CSV template here.
Here is a screenshot of my CSV file (click to enlarge).
When you have your CSV template configured save it and move to the next step.
Step 3. Select Import Options
Select your import options in box 2.
- Enable users = The imported accounts will be set to enabled
- Force Password Change = The import accounts will be required to change their password at next logon.
- Name: LastName, FirstName – By default the name format is FirstName, LastName, if you want to reverse this select this box.
Next, select your CSV template and click run.
When the import process is completed, review the logs for any errors. Errors will be in red and will tell you why the error occurred.
As a reference, it took 45 seconds to create 100 accounts on a virtual machine with 2 GB memory.
You should now see the accounts in Active directory, they should be configured with the settings you specified from the CSV.
Step 4. Verify the Import (Optional)
A quick way to verify the accounts imported correctly is to use the export users tool.
You are not actually going to export anything but you can quickly preview accounts and their settings.
Click on Export Users and click Run (if you want to check users in a specific OU select the OU).
Now you can scroll through the list and verify all of the user fields are set correctly.
CSV Template Cheatsheet
The provided CSV template included 33 user attributes you can use. You can add or remove attributes as needed. Active Directory uses LDAP attribute names to store most account information. This means the user fields you see in Active Directory Users and Computers do not always match with the LDAP attribute name. To create accounts the LDAP field names must be used.
Below is a reference table that shows the LDAP name (CSV Template column) and what it maps to in Active Directory.
For example, the first name in Active Directory = giveName. The office field in Active Directory = physicalDeliveryOfficeName.
If you look at the provided CSV template the example has Test for the giveName (First name) and Nixa Office as the physicalDeliveryOfficeName (Office).
Here is a visual to help illustrate this.
If you need more visual reference refer to the LDAP Field Mappings guide.
Add Additional User fields to the CSV
You can add additional user attributes to the CSV file, you just need to know the LDAP name. You can find the LDAP name by opening the attribute editor in Active Directory Users and Computers. You could also use PowerShell to list all user account properties.
To see the attribute editor you first need to enable the advanced features in Active Directory Users and Computer
Click view from the top menu then select advanced features.
Now when you open an account you will see the attribute editor tab.
The attribute editor screen will show you all the user LDAP properties.
Now just find the attribute name and add it to the CSV. For example, I want to add information to the other Home telephone section for users.
In the attribute editor, I see the name is “otherHomePhone”. I will add this to the CSV.
All done. That is how you add additional attributes to the CSV file to import with new accounts.
In this tutorial, you learned how to import user accounts from a CSV file.
In the next guide, you will learn how to bulk update existing user accounts.Bulk Update Users