Markus
Markus

Reputation: 693

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.

Upvotes: 3

Views: 8796

Answers (1)

Rick Sz.
Rick Sz.

Reputation: 46

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

Upvotes: 3

Related Questions