Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Free eBook

 START HERE NETWORKING NETWORK SECURITY SYSADMIN VIRTUALIZATION  

Free CIDR Subnet Cheat


Sheet

System Administration

Bulk Import Users into Active


Directory from CSV
 January 8, 2022  NetworkProGuide Post Tags

When it comes to IT, automation is your friend. Creating users in your


active directory domain is no exception.
Active
Access Point

Not only does bulk creation of user accounts save you time it also opens Directory ASA Certificates

the door to delegating the work to other people.


Cisco Cisco Prime
I’d like to share with you a couple really simple ways to bulk import user
accounts. The first will be using PowerShell to create active directory
Command Prompt
Config Managment CSV DCDiag DNS Domain
users. The second will be to use a simple and free GUI tool for adding
Controller EdgeSwitch FSMO Roles FTD
users to active directory from CSV.
Group Policy Hyper-V Identity
Using PowerShell to Create AD User Services Engine IOS
Accounts from CSV Sheet ISE Network Access
Before starting, ensure you’re working from either a server with the AD Control Network
role enabled such as a Domain Controller or a workstation that’s running
the Microsoft Remote Server Administration Tools.
Analyzer Network Security 
https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 1/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Relate: How to Install Remote Server Administration Tools (RSAT) for Packet Analyzer
Free eBook
Windows 10
PowerShell RDP Repadmin
Download the pre-formatted CSV sheet and PowerShell script to create
Routing RSAT RSoP SFP SolarWinds
users in active directory here.
SSH Syslog TACACS+ TFTP Ubiquiti
1. Fill in the Required Fields in the CSV Sheet VMware vSphere 6.5 WIFI

Windows 10
Start by opening the downloaded CSV sheet (or creating your own) and
filling out the required fields. These fields are: Windows Server
firstname,lastname,username,password,ou 2016 Windows Server
2019 wireshark WLC

While it’s technically possible to leave the password blank, this will result
in the user account being created in a disabled state and will require a
password be set before the account can be enabled.

Properly Formatting the OU Field


If you open the CSV download provided you’ll see an example of the OU
path syntax.

You can also find this by:

1. Opening Active Directory Administrative Center


2. Opening the Properties of your desired OU
3. Clicking Extentions -> Attribute Editor
4. Navigating to the distinguishedName attribute
5. Copying the Value to the OU field in the CSV sheet


https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 2/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Free eBook

2. Optionally Fill Out the Remaining Fields


The CSV file contains optional fields that you can fill in with relevant data.
If you’re creating your own CSV sheet these fields are:

email,streetaddress,city,zipcode,state,county,description,office,depart
ment,telephone,jobtitle,company

Feel free to add or remove fields from the sheet. Just be sure to
remember to add or remove them from the script as well (it’s really easy).

3. Save the CSV File


Save your file to a known location. You’ll need to open the PowerShell
script and update the “$ADUsers = Import-csv” line to include the full path
to the file.

4.  Update the PowerShell Script with the


Path to the CSV
As mentioned in step 3, we need to let the script know where we saved
our CSV file. Right click the PowerShell script file and click Edit.

Find the line starting with “$ADUsers = Import-csv” (it should be line 11 in


an unmodified version of the scrip file) and append it with the full path
like so:

$ADUsers = Import-csv C:\temp\NewADUsers.csv



https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 3/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Free eBook

5. Update the PowerShell Script UPN Setting


Before we can run the script we need to make one last update to it. We
need to set the domain to be used for the UPN when creating the
accounts.

Find the last block in the PowerShell script and update the “-
UserPrincipalName line (line 48) with your domain like so:

-UserPrincipalName "$Username@npgdom.com" `

Save the file.

6. Run the PowerShell Script to Create AD


Users
Open PowerShell, change your directory to the location of the script, and
run script by entering:

.\NewADUsers.ps1

You can also edit the PowerShell script and click the play button within
PowerShell ISE if you prefer.

At this point you should either be returned to the prompt (if the script run
was successful) or receive a warning if any accounts existed already or
there were any problems with the script.

You can verify the account created by navigating to the OU you specified
in your CSV sheet and looking for the new accounts.

Use Free GUI Tool to Import Users into


Active Directory

https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 4/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

If you’re not the scripting type, or just prefer GUI tools (no shame in that), Free eBook
you’ll be glad to know there are quite a few free options that work great.
One of the easiest to use is SolarWinds User Import Tool  which is part of
their free Active Directory Admin Tools Bundle.

Simply download the bundle and run the UserImportTool.msi to install


the tool.

1. Prep Your CSV Sheet


I have uploaded a preformatted sheet here. You just need to fill out the
relevant fields keeping in mind the required ones:

Given-Name,Surname,Sam-Account-Name,Password

2. Run the User Import Tool


Launch the Solarwinds User Import Tool and select your CSV sheet within
the tool. Select the appropriate radio button for Account Type and then
enter your domain credentials (account must have rights to write to active
directory).

Click next.

3. Map Your Fields


The next screen will ask you to map the fields from the CSV sheet. Since
the fields in the sheet I provided are already named appropriately it
should be pretty easy to match them up.

https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 5/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

You also need to be aware that any field you map from your sheet will Free eBook
become a required field in the tool. Make sure any field you map is filled
out for each user in the CSV file.

Click next.

4. Set Your OU
The next screen has a field at the top for specifying the OU you wish to
create your user accounts in. Click Set to set the OU.

5. Create Your AD User Accounts


At this point you just need to verify everything in the preview looks correct
and click Create.

Just as before, you can verify the accounts were created by navigating to


the OU you specified and look for the new accounts.

Hopefully this tutorial was easy to follow and saves you time and
heartache in the future.

Get the Free User Import Tool Here

Recommended for You: Solarwinds


Server & Application Monitor (SAM)
Know which
applications are
having issues in
your environment
before users
complain? Know
which systems are
causing those
problems? How
about which
servers are about to have problems like running out of space or memory?

Automate collection of data and alerting on your applications and servers


with Solarwinds Server & Application Monitor so you have these answers.

Get insight into Active Directory, DNS, DHCP, and your Virtual and
Applications environments without needing to mess with complex
templates or knowing a single line of code.


https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 6/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Check It Out Here Free eBook

← Upgrade Cisco IOS Switch Step-by-Step

Using Account Lockout Tool to Troubleshoot AD Lockout →

Leave a Reply
Your email address will not be published. Required fields are marked *

Comment *

Name *

Email *

Post Comment

About Us Pages Notice

Earnings Disclosure
Privacy Policy

Terms of Service
https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 7/8
4/6/22, 5:13 PM Bulk Import Users into Active Directory from CSV | NetworkProGuide

Copyright © 2022 NetworkProGuide. All rights Free eBook


reserved.

 


https://networkproguide.com/bulk-import-users-into-active-directory-from-csv/ 8/8

You might also like