PowerShell: Set User Option Change Password At Next Logon

$ou="OU=Users,DC=corp,DC=hooli,DC=com"
$usersInOu=Get-ADUser -Filter * -SearchBase $ou
$usersInOu|Set-ADUser -CannotChangePassword:$false -ChangePasswordAtLogon:$false

Leave a Reply

Your email address will not be published. Required fields are marked *