Windows Server 2016-批量设置用户下次登陆须更改密码

Powershell设置某OU下所有用户下次登陆必须更改密码:

Get-ADUser -Filter * -SearchBase "ou=syncall,dc=azureyun,dc=com" |Set-ADUser -ChangePasswordAtLogon $flase

批量取消当前域环境中已勾选下次登陆必须更改密码选项:

Get-ADUser -Filter * | foreach {Set-ADUser -Identity $_.SamAccountName -ChangePasswordAtLogon $false}

小温

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: