Quick Post – Script to Create Lab Users – Powershell version…
A long time ago I posted a VBSCRIPT and CSV file which when executed created over 300 user accounts in Active Directory which was designed to give you a number of test accounts which could be used within a LAB environment to test Exchange Server.
As mentioned the original script was based around VBSCRIPT and Exchange 2003 and also required a little bit of manual intervention in order for it to work within your specific environment.
Predominantly it was designed to work against Windows 2000 / 2003 server AD environments – however as time has elapsed its underling functionality has been superseded with the advent of Powershell / Windows 2008 and Exchange 2007 and 2010 to the point that under certain system configurations it will no longer work.
Therefore given the above (and that I have been rebuilding my test lab) I am pleased to present to you with an updated CSV file and script (where the script is now Powershell based) – which supports the following scenarios:
- Can be executed via Powershell versions 1.0 and 2.0
- Can be run on the following Operating Systems: Windows 2008 and Windows 2008 R2 (will also support Windows 2003 with Powershell installed)
- The accounts created can be configured with mailboxes for Exchange 2007 and Exchange 2010
So, if you are creating a test lab which is based around the above technologies and would like an easy way to get over 300 unique accounts into your Active Directory environment please feel free to download the following file to either your LAB Domain Controller or Exchange Server:
The above file is a self extracting ZIP which when executed with extract two files to you Exchange Server / Windows 2008 Domain Controller.
When you have downloaded and extracted the scripts to your server – open a Powershell Console and navigate to the location where they are located – when there type in:
.\CreateUsersFromCSV.ps1 and then press – see below;
When the script executes you will be presented with a Windows “Open” dialog box – navigate to the location where you extracted the files and then choose the sample CSV – see below;
The script will then execute creating each user in your Active Directory Lab environment – the Default password is “Password1” – see below;
When the script has completed – open Active Directory Users and Computers – you will see a new OU called “ExchangeUsers” – within this OU are the new accounts that you can play with – see below;
I hope that you find the above useful.