2020 | Scott W. Head  |  Sr. Systems Admin | Certified Microsoft Windows Server Administrator

PowerShell New-ADUser

Replace the values below before running the script.

$FirstName = "Scott"

$LastName = "Head"

$SamAccount = "Shead"
$Password = "Th1sP@ssw0rrd"

$ServerName = "PrimaryDC"

$Description = "Sr. Systems Admin"

$UPN = "$SamAccount@JCR.Local"

$OU= "OU=hold,DC=jcr,DC=local"

New-ADUser -server $ServerName -Name $FullName -SamAccountName $Samaccount -DisplayName $FullName -GivenName $FirstName -Surname $LastName -UserPrincipalName $UPN -Enabled $true -ChangePasswordAtLogon $False -AccountPassword (ConvertTo-SecureString -AsPlainText "$PassWord" -Force) -passthru -PasswordNeverExpires $True -CannotChangePassword $True -Description  $Description -Company "Bitahelp LLC" -Path $OU