How can I force all domain users to change their password now? I want to do so before users next logon.
Thanks
How can I force all domain users to change their password now? I want to do so before users next logon.
Thanks
Use a combination of dsquery
and dsmod
eg
dsquery user "OU=Sales,OU=New York,dc=internal,dc=AcmeCorp,dc=com" | dsmod user -pwd ChangeThisNow! -mustchpwd yes -u Admin -p APassword
This would change password of all users in Sales in New York to "ChangeThisNow!" and force them to change it on login.
Here's a reference on dsmod
If you are using PowerShell, this command will force all users in the current domain to choose a new password next time they log in.
Get-ADUser -Filter "*" | Set-ADUser -ChangePasswordAtLogon $true
If you want to be more precise about which users are affected, you can narrow it down to an organizational unit.
$users = Get-ADUser -Filter "*" -SearchScope Subtree -SearchBase 'DC=contoso,DC=com'
$users | Set-ADUser -ChangePasswordAtLogon $true
More options can be found here: Migrated Users Get Prompted To Change Password at First Logon (blogs.technet.com).
-Filter *
in that first Get-ADUser
example? As written, it doesn't work without additional prompting.