Automatically Create Users in AD

Here’s a PowerShell script I put together to import users into AD (Active Directory). You just need to edit the .CSV file to add your users into it, then simply run the script pointing to the .CSV file.

This is good for testing purposes.

Prior to running the script, ensure that you have added your email domains to AD as UPNs to the domain and also that you have extended the schema for Exchange, to add in the all the Exchange attributes.

It also supports multiple email domains, if you don’t have multiple email domain, hash out the third line and the second last line.

Here is the CSV file, copy and paste into a text file and rename to *.CSV.

GivenName,SurName,Description,Title,StreetAddress,City,State,Country,PostalCode,OfficePhone,MobilePhone,Department,Office,AccountPassword,Enabled
Brad,Herald,Test User,,,Sydney,NSW,AU,2077,,,,,Passw0rd,$true
Frank,McDonald,Test User,,,Sydney,NSW,AU,2078,,,,,Passw0rd,$true
Jason,Freddo,Test User,,,Sydney,NSW,AU,2079,,,,,Passw0rd,$true
Amber,Parsons,Test User,,,Sydney,NSW,AU,2080,,,,,Passw0rd,$true
Amanda,Peters,Test User,,,Sydney,NSW,AU,2081,,,,,Passw0rd,$true
Marc,Brosnan,Test User,,,Sydney,NSW,AU,2082,,,,,Passw0rd,$true
Ranger,Due,Test User,,,Sydney,NSW,AU,2083,,,,,Passw0rd,$true
Sue,Murphy,Test User,,,Sydney,NSW,AU,2084,,,,,Passw0rd,$true
Nicola,Newland,Test User,,,Sydney,NSW,AU,2085,,,,,Passw0rd,$true
Peter,McKenzie,Test User,,,Sydney,NSW,AU,2086,,,,,Passw0rd,$true
Barbara,Walters,Test User,,,Sydney,NSW,AU,2087,,,,,Passw0rd,$true
Michael,Hound,Test User,,,Sydney,NSW,AU,2088,,,,,Passw0rd,$true
Jessica,Andrews,Test User,,,Sydney,NSW,AU,2089,,,,,Passw0rd,$true
Sarah,Cummings,Test User,,,Sydney,NSW,AU,2090,,,,,Passw0rd,$true

Here’s the finished result.

Computers and Internet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: