I had to create quite a lot of AD user accounts. To facilitate the task, I’ve used the PowerShell according to instructions from the TechNet-Community.
I’ve created a CSV-file with six columns: Name, UserPrincipalName, SurName, FirstName, Displayname, Password
Name,UPN,SurN,FirstN,DN,Pass
cocoreat,cocoreat@domain.local,Repeat,CoffeeCode,CoffeeCodeRepeat,Password
Then I’ve used the the PowerShell-Cmdlet “New-ADUser” to iterate over the file and create the user accounts with their properties.
$users = Import-Csv CreateUsers.csv
$users | ForEach-Object { New-ADUser -Path 'OU=PCs,DC=lab,DC=wu,DC=ac,DC=at' -Name
$_.Name -Surname $_.SurN -GivenName $_.FirstN -UserPrincipalName $_.UPN -DisplayName
$_.DN -AccountPassword (ConvertTo-SecureString -AsPlainText $_.Pass -Force) -Enabled
$True}