项目作者: unsolaci

项目描述 :
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.
高级语言: PowerShell
项目地址: git://github.com/unsolaci/Reset-ADAccountPassword.git
创建时间: 2020-12-18T13:15:27Z
项目社区:https://github.com/unsolaci/Reset-ADAccountPassword

开源协议:Apache License 2.0

下载


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

  1. .\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

  1. PS C:\>& .\Reset-ADAccountPassword.ps1 -Identity johndoe -NewPassword (Read-Host -Prompt 'NewPassword' -AsSecureString) -Unlock -MustChangePasswordAtLogon

EXAMPLE 2

  1. PS C:\>& .\Reset-ADAccountPassword.ps1 -Identity johndoe -NewPassword 'P@$$w0rd' -AsPlainText -Force -MustChangePasswordAtLogon