Skip to content

Instantly share code, notes, and snippets.

@mike-myers-tob
Created November 25, 2020 04:25
Show Gist options
  • Save mike-myers-tob/1f30c1f0ba994b31d9f7c3cd40bf50ee to your computer and use it in GitHub Desktop.
Save mike-myers-tob/1f30c1f0ba994b31d9f7c3cd40bf50ee to your computer and use it in GitHub Desktop.
PowerShell to create 100k local users
# 1) The 100k users CSV file is here: https://docs.google.com/spreadsheets/d/1yPr_eutYWxUZX5ZhygvaMwi15aLVsjWNs275kQI4Q9A/edit?usp=sharing
# 2) Download it as a CSV, rename it to Users.csv in the directory of this script.
# 3) Run this script in an Administrator PowerShell prompt. It will take probably 10-20 minutes to complete.
$dataSource=import-csv "Users.csv"
foreach($dataRecord in $dataSource) {
$displayName = $dataRecord.FirstName + " " + $dataRecord.LastName
$userName = $dataRecord.FirstName
New-LocalUser -Name $userName -FullName $displayName -Description "Test user" -NoPassword -Disabled
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment