Friday, June 17, 2016

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!



                         Figure-1: Creating users in my testing domain





                        Figure-2: My sample csv file.


2 comments:

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

    ReplyDelete
    Replies
    1. 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.

      Delete

Note: Only a member of this blog may post a comment.