Creating Active Directory Users in the Nested OUs

It is the powershell script that will automatically create AD users. What makes it unique is that all the necessary OUs (even nested OUs) are created in advance before users creation. So, you won’t need a separate script for both tasks. Here, I give the screenshot of my testing domain, with example users defined in my csv file.

You must include these properties as the csv file headers (See Fig-2). But leave the values blank if some users do not have these properties.

EmployeeID, DisplayName, OU, Description, Name, GivenName, SurName, SamAccountName, Title, Departement, Domain, Office, OfficePhone, Company, EmailAddress, Password

It takes only 3 min to create 1500 users for me, Cheers!

Create AD Users in nested OU with Powershell

Fig-1: Demo of AD user creation

Sample CSV file for AD user creation

Fig-2: Sample CSV file

You can download my script from github.

This entry was posted in Powershell. Bookmark the permalink.

2 Responses to Creating Active Directory Users in the Nested OUs

  1. Unknown says:

    The following fields are invalid or blank in your csv columns. Please Check and correct.
    can you describe why this error happen

  2. Hi,
    You need to put all headers as shown in my script. But you can leave blank if the users are not using a particular value.

Leave a Reply

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