I want to reset a bunch of user passwords, forcing them to choose a new one on their next login.
But what is the difference between Set-MsolUserPassword Parameter "ForceChangePassword" and "ForceChangePasswordOnly"?
Documentation here is incomplete and most sites in the web use both parameters like this: Set-MsolUserPassword -ForceChangePasswordOnly $true -ForceChangePassword $true, but also without a detailed explanation of both params.
-ForceChangePassword $true requires user to change password at next login. -ForceChangePasswordOnly $true prevents the command Set-MsolUserPassword from generating a random password if no password (-newpassword "123456") is on the command line.
Set-MsolUserPassword -userprinciplename [email protected] -ForceChangePassword $true Would generate a random password for the user ans set the flag that they must change the password. Set-MsolUserPassword -userprinciplename [email protected] -ForceChangePasswordOnly $true -ForceChangePassword $true
Would not generate a password and just cause user to be prompted to change the password.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With