Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.32 KB

README.md

File metadata and controls

43 lines (31 loc) · 1.32 KB

Reset-ADAccountPassword.ps1

SYNOPSIS

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.

SYNTAX

.\Reset-ADAccountPassword.ps1 [-Identity] <ADUser> [[-NewPassword] <Object>] [-AsPlainText] [-Force] [-Unlock] [-MustChangePasswordAtLogon] [<CommonParameters>]

PARAMETERS

-Identity

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