Navigation Menu

Sunday, 10 May 2015

Import Bulk AD Users from CSV using PowerShell

Creating Bulk Active Directory Users in AD is one of important task for every Administrator either for testing or for set of actual new employees. Normally you can create new AD user using ADUC console. But it is time consuming job if you want create multiple ad users. To overcome this hurdle, every administrator should rely on any of a script technology like VBScript and Powershell. In this article. I am going write and explain Powershell Script to Create Bulk Active Directory Users from CSV.

Create Bulk AD Users from CSV file with OtherAttributes

1. Consider the CSV file NewADUsers.csv which contains set of New AD Users to create with required Active Directory attributes (i.e. Name, samAccountName and ParentOU).

Note: the value of ParentOU should be enclosed with double quote ("). like "OU=TestOU,DC=TestDomain,DC=Local" since it has the special character comma (,). because in csv file the comma (,) is the key character to split column headers. (Ex file: Download NewADUsers.csv).

2. Copy the below Powershell script and paste in Notepad file.
3. Change the NewADUsers.csv file path with your own csv file path.
4. Change the domain name TestDomain.local into your own domain name.
5. Add more other ad attributes with the parameter -OtherAttributes.
6. SaveAs the Notepad file with the extension .ps1 like Create-Bulk-AD-Users-CSV.ps1