How to Log Out User Sessions in SharePoint Online?

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 clicking on the “Sign out” link. 

how to sign out of sharepoint online

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 log off 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 Salaudeen@crescent.com -Confirm:$false 

This prompts for credentials to connect to the SharePoint Online admin center, disconnects all sessions of a given user, and takes them to the login page.

sharepoint online sign out

You can also end the user sessions using PnP PowerShell:

Revoke-PnPUserSession -User Salaudeen@crescent.com

This will sign out the user from everywhere, including browser, desktop, and mobile applications across all devices.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *