We first need to set the –AccountPassword in order to Enable the account 

$Password = Read-Host "Enter the Password" -AsSecureString

 

The following command creates 20 Labusers and if you’ve already enter the password by using Read-Host above it sets the password and enables the user accounts. LabUser01, 02, 03 till 20 will be created. 

1..20 | ForEach {New-ADUser -Name "LabUser$_" -AccountPassword $Password -Enabled $True -Path "OU=TestOU,DC=mydomain,DC=edu,DC=local"}

ennlfrdeitptruestr
JSN Epic template designed by JoomlaShine.com