Created
March 31, 2017 19:28
-
-
Save infamousjoeg/9b6378dea9212c17660e8ef776166a75 to your computer and use it in GitHub Desktop.
Create 1,000 Test Users for Home Lab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module ActiveDirectory | |
$total = 1000 | |
for ($userIndex=0; $userIndex -lt $total; $userIndex++) | |
{ | |
$userID = "{0:0000}" -f ($userIndex + 1) | |
$userName = "test.user$userID" | |
Write-Host "Creating user" ($userIndex + 1) "of" $total ":" $userName | |
New-ADUser ` | |
-AccountPassword (ConvertTo-SecureString "Cyberark1" -AsPlainText -Force) ` | |
-City "Tampa" ` | |
-Company "CyberArk Software" ` | |
-Country "US" ` | |
-Department "QA" ` | |
-Description ("TEST ACCOUNT " + $userID + ": This user account does not represent a real user and is meant for test purposes only")` | |
-DisplayName "Test User ($userID)" ` | |
-Division "Americas" ` | |
-EmailAddress "[email protected]" ` | |
-Enabled $true ` | |
-Fax "813-555-$userID" ` | |
-GivenName "Test" ` | |
-HomePhone "813-556-$userID" ` | |
-Initials "TU$userID" ` | |
-MobilePhone "813-557-$userID" ` | |
-Name "Test User ($userID)" ` | |
-Office "US-Southeast"` | |
-OfficePhone "813-558-$userID" ` | |
-Organization "CyberArk Software" ` | |
-Path "CN=Users,DC=joe-garcia,DC=local" ` | |
-PostalCode "33601" ` | |
-SamAccountName $userName ` | |
-State "FL – Florida" ` | |
-StreetAddress "$userID Kennedy Blvd" ` | |
-Surname "User ($userID)" ` | |
-Title "QA Analyst" ` | |
-UserPrincipalName "[email protected]" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment