Force logoff of Office 365, OneDrive, and Sharepoint Online

There are situations you will want to be able to force a logout of a user from Microsoft Office 365 services.  Two common situations are when a user is terminated or an account has been compromised.  First you should either disable the account if the user is leaving the company or change the password in the case of a compromised account.  Next you can use the GUI or PowerShell to initiate a sign-out from the cloud services.

Using the GUI:

  1. Open the Microsoft 365 Admin Center.
  2. Under Users select Active Users.
  3. Next click on the desired user.  Select the OneDrive tab and click the link to Initiate sign-out.

Using PowerShell:

  1. Open PowerShell as Administrator.
  2. Connect to Azure AD with the following command:
  3. Run the following command to sign-out the user of all active sessions.
    Get-AzureADUser -SearchString | Revoke-AzureADUserAllRefreshToken