Forum Discussion

JamesCumberton's avatar
JamesCumberton
Copper Contributor
Jan 07, 2021

Password Expiry/Reset

Is it possible to have when a user's password expires it logs that user out so they are forced to reset it. Currently the notification appears for the user but they only have to reset it when they lo...
  • boneyfrancis's avatar
    Jan 07, 2021

    Hi JamesCumberton,

     

    Technically, you can. In our organization we wanted to force sign-out users when their accounts get disabled or passwords are reset/changed, and so instead of waiting for the Azure refresh token to expire we solved the situation by running the following cmdlet when that action occurs:

      Set-MsolUser -UserPrincipalName $User -StsRefreshTokensValidFrom (get-date)
     
    The key is, you'll need an interceptor to trigger this action when the condition occurs. If your domain is federated, it's your your on-premise AD should have a interceptor that can catch when password change/password expiry/account disable happens, and then execute the MSOL cmdlet to revoke the Azure token (or like how we have done, place the script in an Azure runbook, create a webhook, and have the AD interceptor call the Webhook and pass the username).

Share

Resources