SharePoint Online: Change Idle Session Timeout Settings

Task: Set idle session timeout value for SharePoint Online.

How to Set SharePoint Online Idle Session Timeout?

Did you know that there is a session timeout for SharePoint Online? Well, Idle session timeout in SharePoint Online is a security mechanism that warns and sign-outs the user after a period of inactivity. By default, idle session timeout settings are disabled in SharePoint Online. In this post, we will walk through how to modify your session timeout settings for SharePoint Online. We’ll also provide some tips on how to extend your session timeout beyond the default setting.

To enable idle session timeout in SharePoint Online, follow these steps:

  1. Login to SharePoint Online Admin Center
  2. Click on “Policies” >> Access Control >> Idle session Sign-out
  3. Turn-On the Idle session timeout and set other configuration parameters accordingly.
    idle session sign out in sharepoint online

This ensures that your users’ sessions are terminated after a set amount of time of inactivity, which can help to improve security and performance. The idle timeout settings apply only to web browsers – It doesn’t affect any clients such as the OneDrive Sync client – they stay logged in as usual.

SharePoint Online: Configure Idle Session Timeout using PowerShell

To set default session timeout values, use the PowerShell cmdlet: Set-SPOBrowserIdleSignOut, Open SharePoint Online Management Shell, and run this PowerShell script to change SharePoint Online session timeout:

#Set Config parameters
$AdminSiteURL = "https://crescent-admin.sharepoint.com/"

#Connect to SharePoint Online Tenant Admin
Connect-SPOService -URL $AdminSiteURL -Credential (Get-Credential)

#Get Current Idle session Timeout values
Get-SPOBrowserIdleSignOut

#Change Session Timeout Value
Set-SPOBrowserIdleSignOut -Enabled $true -WarnAfter (New-TimeSpan -Minutes 30) -SignOutAfter (New-TimeSpan -Minutes 60)

#Verify the settings
Get-SPOBrowserIdleSignOut
Tips: You can use “Get-SPOBrowserIdleSignOut” to get the current idle session timeout value!

This setting dictates how long a user’s session is allowed to remain idle before it is automatically terminated. By default, this value is set to 0 minutes, meaning that the user’s session will not expire until they explicitly log out. However, by adjusting this setting, you can control how much time a user has before their inactive session is terminated.

sharepoint online session timeout setting
So, after executing the above script, SharePoint Online gives a warning after 30 Minutes. If the users press the continue button, they can continue working until the next time they leave the browser window idle for the warning period configured.

change sharepoint online session timeout

And if there is no activity from the end-user, then SharePoint Online automatically redirects to the sign-out page.

sharepoint online idle session timeout
Please note: Changes to the idle session settings takes effect ONLY on new sessions. Existing browser sessions don’t get affected (until user close and re-open a new browser session!). Also, if the user selected “Keep me Signed in” – these timeout settings don’t affect that user!.

How to Disable Idle Session Timeout in SharePoint Online?

To Disable Idle session timeout, use the following:

Set-SPOBrowserIdleSignOut -Enabled $False

SharePoint Online: Set Inactivity Timeout using PnP PowerShell

Here is how to set idle session timeout in SharePoint Online using PnP PowerShell:

To check the Browser idle timeout value configured:

To verify that the new idle session timeout value has been set, use the following script:

#Parameters
$AdminCenterURL = "https://crescent-admin.sharepoint.com"

#Connect to PnP Online
Connect-PnPOnline -Url $AdminCenterURL -Interactive
 
#Get Browser session timeout configured
Get-PnPBrowserIdleSignOut

To configure timeout settings:

Let’s set the browser idle session timeout warning to 30 minutes and Sign out after 1 hour:

#Parameters
$AdminCenterURL = "https://crescent-admin.sharepoint.com"

Try {
    #Connect to PnP Online
    Connect-PnPOnline -Url $AdminCenterURL -Interactive
 
    #Set Browser session timeout
    Set-PnPBrowserIdleSignOut -Enabled:$true -WarnAfter (New-TimeSpan -Minutes 30) -SignOutAfter (New-TimeSpan -Hours 1)
}
Catch {
    Write-host -f Red "Error:" $_.Exception.Message
}

Conclusion

In SharePoint Online, the idle session timeout refers to the amount of time a session can remain idle before the user is automatically logged out. This timeout feature is implemented to improve the security of the SharePoint environment and prevent unauthorized access to user data. The idle session timeout can be customized to meet your organization’s needs, providing a balance between security and user convenience.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

2 thoughts on “SharePoint Online: Change Idle Session Timeout Settings

  • …what about the same situation OnPremise version?

    Reply
  • Hello,

    Really appreciate your work!
    I just want to check whether there is option to set session timeout for SharePoint On-Premises when we are using Windows authentication?

    TIA.

    Reply

Leave a Reply

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