Requirement: Force Log Off all sessions of a user, as he lost his mobile device which is logged-in with SharePoint Online sites.
How to sign out of SharePoint Online?
As an end-user, you can sign out from SharePoint by clicking on the User icon in the welcome menu, and then click on “Sign out” link.
Once you are signed out, you’ll see a message “You’re signed out of Office 365”.
PowerShell to Log Out User from All Sessions in SharePoint Online
We can force logoff a user from all his sessions opened with SharePoint Online using Revoke-SPUserSession cmdlet. Here is how:
#Connect to SharePoint Online Connect-SPOService -URL https://crescent-admin.sharepoint.com -credential (Get-Credential) #Logoff User Revoke-SPOUserSession -User [email protected] -Confirm:$false
This prompts for credentials to connect to the SharePoint Online admin center and disconnects all sessions of a given user and takes them to the login page.