Last active
September 8, 2017 15:37
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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