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}

05-11 00:40