How to set user password expired immediately??

Copper Contributor

Hi!  Is it possible to set an user's password expired immediately? 

3 Replies

Some context might help? You can force the user to change his password if that's what you mean. 

I am trying to test my app's error handling. One of which is handling when the user's password has expired. Specifically, I am trying to get the exception message "Authentication Error: Password has expired."

Hi @LennartSkyKick 

 

If this is a cloud-only account you can try the following powershell to force the user to change password on next sign in:

 

Set-MsolUserPassword -UserPrincipalName <your user> -ForceChangePassword $true

 

This is what @Vasil Michev was talking about and should provide a the response that the password needs to be changed.