Bulk create standard set of AD Groups and test Accounts for Project Server Lab

Project Server 2013 has arrived and I have built a new 2013 Farm in my Lab. I often wind up having to create new Active Directory servers and set up Project Server AD Groups populated with test accounts. This takes time away from more valuable tasks so I created a PowerShell script that will automate the work for me. Also when it comes time to perform load testing on Project Server it is necessary to populate the Resource Pool and User Groups with between 10,000 to 25,000 users. This script if perfect for creating the thousands of accounts where you can control creation of Project Manager, Team Member... accounts in AD for mapping to Project Server. The Admin panel in PWA allows the Project Server Application Administrator to map AD Groups generated by this script to Project Server Groups in order to Synchronize the two systems and thus creating the Project Server Resource Pool and User Access accounts with passwords.

Personally I like to use this script in PowerShell ISE environment. If you do not know about this tool here are some details. https://technet.microsoft.com/en-us/library/dd315244 or https://technet.microsoft.com/en-US/library/dd819451.aspx. What I do is select portions of the script with my mouse and run with F8 command. This way you can see step by step what the script is doing. When you finish setting all the variables to suit your environment and test for a while, you can run it as a script in PowerShell Console. If you want to use the ISE, you can install it on Windows Server 2008 R2 from Server Manager, Add Feature.

Basically the scrip asks if you want to create a new OU or not, new AD Groups or not and new Accounts in these groups or not. When it asks to create accounts is asks how many, what Prefix to use, what AD group to drop them into and a starting point for sequential numbering of each user. If the OU or AD groups already exist it will notify you and keep going. If you try to enter duplicate users it will error and keep going.

 Here is a link to my script, enjoy.