Put a scenario that you are a junior administrator or a helpdesk that has administrative privilege to create accounts (objects) to a specific Organizational Unit (OU). Then your Data Analytics Team generated information that the demand on the services your organization offers will be high on demand for the next quarter. Management then decide that they need more people to keep up with the forecasted demand.
Human Resources then gave you 200 Hired Employees to process their accounts, you then realize the Active Directory Users and Computer (ADUC) don’t support adding users in bulk. These employee accounts needs be created and ready for use the next day. What do you do?
Fortunately, I have experienced this pain in the neck before and wanted to share how I overcome the challenge to administrators out there that is experiencing the same problem. I show the steps that needs to be followed in the next section:
Download the powershell script and the csv file template here.
Note: the csv file template has sample data on it, you can replace them with actual data to create.
Fill in the account information in the csv file, this step is usually taken care of HR.
Note: for the script to work properly, names in the displayName field in the csv file must contain middle initial. (Ex. Sheen Ismhael A. Lim). No other Dot (.) character must exist except in the middle initial, which is required.
Execute the powershell script.
PS C:\Windows\system32> & ‘C:\Users\Sheen Ismhael Lim\desktop\Import-ADUsers.ps1’
-csvFileLocation ‘C:\Users\Sheen Ismhael Lim\desktop\excelTemplate.csv’
-organizationUnit “OU=Users,OU=Cagayan De Oro,OU=Offices,DC=limdynasty,DC=com”
Note: There 4 parameters that the script need to work.
csvFileLocation: The location of the excelTemplate.csv with the data to import.
organizationUnit: The distinguished name of Organizational Unit (OU) container to put the new accounts.
defaultPassword: The default password of the accounts to be created.
fqdn: is the domain part in the userPrincipalName of the account.
This is the sample output of the script:
Hope it helps,
For God and Country!