Skip to content

Instantly share code, notes, and snippets.

@ntrogers
Last active September 8, 2017 15:37
Show Gist options
  • Save ntrogers/59ba509d95823a6c6bcba219b88eb626 to your computer and use it in GitHub Desktop.
Save ntrogers/59ba509d95823a6c6bcba219b88eb626 to your computer and use it in GitHub Desktop.
[AD - Create/Edit AD User] Create/edit AD user via powershell, password in plain text #Windows #Powershell #ActiveDirectory
New-ADUser -SamAccountName <userName> -GivenName <firstName> -SurName <lastName> -Name "<firstName> <lastName>" -DisplayName "<firstName> <lastName>" -UserPrincipalName <userName>@<domain> -ChangePasswordAtLogon $true -AccountPassword (ConvertTo-SecureString <password> -AsPlainText -force) -Enabled $True -PasswordNeverExpires $False -PassThru -Path "OU=<ou>,OU=<path>,DC=<domain>,DC=<path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment