Reset AD account password and set AD user parameters. Basically, a quick command line version of Active Directory Users and Computers'(dsa.msc) password reset dialog.
.\Reset-ADAccountPassword.ps1 [-Identity] <ADUser> [[-NewPassword] <Object>] [-AsPlainText] [-Force] [-Unlock] [-MustChangePasswordAtLogon] [<CommonParameters>]
Active Directory user object to perform operations on
-NewPassword
Set new password for the account without providing old one
-AsPlainText
Specify a plain text password instead of secure string
-Force
Confirm that you understand the implications of using the AsPlainText parameter and still want to use it
-Unlock
Unlock AD account
-MustChangePasswordAtLogon
Set ChangePasswordAtLogon flag to $true
EXAMPLES
EXAMPLE 1
PS C:\>& .\Reset-ADAccountPassword.ps1 -Identity johndoe -NewPassword (Read-Host -Prompt 'NewPassword' -AsSecureString) -Unlock -MustChangePasswordAtLogon
EXAMPLE 2
PS C:\>& .\Reset-ADAccountPassword.ps1 -Identity johndoe -NewPassword 'P@$$w0rd' -AsPlainText -Force -MustChangePasswordAtLogon