Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set-MsolUserPassword, ForceChangePasswordOnly-Parameter not documented

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.

like image 367
Markus Avatar asked Feb 11 '26 14:02

Markus


1 Answers

-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.

like image 81
Rick Sz. Avatar answered Feb 13 '26 17:02

Rick Sz.