Forum Discussion

LennartSkyKick's avatar
LennartSkyKick
Copper Contributor
Oct 14, 2019

How to set user password expired immediately??

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

  • LennartSkyKick's avatar
    LennartSkyKick
    Copper Contributor
    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."
    • HidMov's avatar
      HidMov
      Steel Contributor

      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 VasilMichev was talking about and should provide a the response that the password needs to be changed.

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

Resources