Create Realistic Lab Users

In testing out some of my other tools over the last few weeks, I've found it necessary to create a some test users. A lot of test users. Not a normal "a lot," either. I needed hundreds of thousands at a minimum, a million if possible, as fully fleshed-out can be. And here we are.

5 Star
2,642 times
Add to favorites
Active Directory
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Stop OU creation
    2 Posts | Last post September 11, 2019
    • How can we modify the script to prevent the OU creations? We specify a path to create the user accounts but do not want  all of the sub OUs to be created. Can we just comment out the Function Create OUs?
    • Unfortunately, the design of the tool is to create a structure.  You'd most likely cause errors if you commented out the function, and the group memberships are built and nested based on the structure of the OU.  You could move everyone afterwards.
  • Can't create Mailboxes : ExternalEmailAddress is mandatory on MailUser.
    1 Posts | Last post August 04, 2019
    • Hi Aaron, 
      Thanks for making this script real.
      I'm trying to create only a hundred users and enbale mailboxes, after running the script, 
      I get this warning before getting a user's details. 
      The script did not throw any error., my CSV file is on the right format, the 100 users are present in AD , and Exch, 
      did i miss sthg in the script ?
      The object MYLAB/SF/Washington/Finance/Bat106 L T has been corrupted, and it's in an inconsistent state. The following validation errors happened: 
      ExternalEmailAddress is mandatory on MailUser. 
      The mail contact and mail user must have a valid external e-mail address. 
  • Mailbox Inflation: 5.6.0 Errors?
    1 Posts | Last post January 08, 2019
    • Has anyone seen an error Invalid Message Content when executing the inflation? I've seen successful sends of 1 out of 4 messages running against Exchange 2013.
  • Specific Users
    7 Posts | Last post December 12, 2018
    • Hello Aaron,
      I love your script and have really enjoyed using it. I've already tried out that 'whole shebang' switch, fantastic!
      I was wondering if it's possible to allow for an input file of a specific set of users to be created. The example is that while I enjoy the bulk user objects, I do want to have a few usernames that are always in my lab so when I need a test user, I don't have to go searching. Would you be interested in accepting an input CSV as a "I'll create these users first, for the first x users, then run my randomization afterwards". I typically run my own script to create all the MCU characters (Peter Parker, Steve Rogers, etc.) prior to running your script, but it didn't make sense to have users with different levels of authenticity.
      Second thought, I haven't tested it yet, but does your script work with Office365 MSOL objects/mailboxes? Not that I'd want 50,000 licensed MSOL mailboxes, but having 50-100 that were fully inflated would be nice.
    • I've added a UserList parameter. ;-)
      You just need to specify the -UserList and a path to a CSV.  CSV must be formatted with header and contain columns:
      I've also updated the InflateMailboxes parameter to use Get-Recipient instead of Get-Mailbox, and scoped it to MailUser,SharedMailbox,RemoteUserMailbox,UserMailbox.  If you have run Enable-RemoteMailbox on an object or have just created MEU's in your on-premises environment, you'll be able to use the InflateMailboxes parameter against them.
    • Aaron - Next revision, could you add error handling for a no middle name scenario when generating from a userlist?
    • I've added that as well.  You'll still need the columns FirstName,MiddleName,LastName but if a column is blank, I'll just grab one from the $Names array that contains first names.
      Here's how a CSV might look:
    • I've also added some validation to ensure you have FirstName,MiddleName,LastName columns if you use the UserList parameter.  You don't have to have them all filled in, but they must exist.
      Any of those formats will work and the missing fields will be filled in.
    • Aaron, fantastic! I've never seen someone so responsive. Still love the script.
      Is it possible to skip the middle name entirely for the input file users? I'd like the samaccountnames to be easy to remember, and if each lab has random middle names injected I still have to look up random test accounts if I need to login as that user object.
      Thank you!
    • Any word on if there's a way to skip the middle name?
  • Requirement of Exchange AD Schema Extension ?
    1 Posts | Last post November 14, 2018
    • Hello,
      Great Script ! 
      Worked fine on one lab config with AADConnect and hybrid Exchange Server 2016.
      But when I tested it on a fresh new W2016 Server - new Forest, only 1 DC without any Exchange server-, I have seen  an error on user creation, about missing MailNickName Attribute in my Active Directory.
      I just only wanted to create OUs/Users and Groups, no mail entries needed.
      And effectively, this new AD wasn't setuped / extended for Exchange so no mailnickname attribute. 
      Is it possible to :
      - add a switch like -NoExchangeSchema to remove dependances of Exchange AD Schema extension ?
      - detect automatically the Exchange AD Schema extension
  • Powershell v2.0
    2 Posts | Last post July 30, 2018
    • Hey Aaron, 
      The script bombed when running from an Exchange 2010 Server. Just needs a #requires -version 4 
      No issues when running from a different Server with a higher PS version and remoting to the same E2010. 
    • Cool. Thanks for the idea!