There was a need to create a large number of users in Active Directory and what better way to achieve such a goal than to use PowerShell?!
And execute the following in PowerShell ISE:
$csv = Import-Csv -Path "C:\Scripts\users.csv"
ForEach ($item In $csv)
$pwdLength = 15
$noNonAlphaChar = 5
$pw = [Web.Security.Membership]::GeneratePassword($pwdLength,$noNonAlphaChar)
$spw = ConvertTo-SecureString -AsPlainText $pw -Force
$create_user = New-ADUser -DisplayName $item.Name -Name $item.Name -SamAccountName $item.SAMName -AccountPassword $spw -Description $item.Description -Path $item.OU
Write-Output "User $($item.Name) with $pw created!"
Note that the created accounts will be disabled. Additionally you might want to consider locking the accounts down to only log on to certain systems as well as having an expiring date and the user not being able to change the password – basically follow whatever policies the organisation has in place.