Skip to content

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.

License

Notifications You must be signed in to change notification settings

unsolaci/Reset-ADAccountPassword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published