Skip to main content

Time limit for disconnected sessions

This policy setting lets you configure a timeout for disconnected Remote Desktop Services sessions on all Windows servers that you use for Load Balancing.

By default, the user always receives a new session as soon as the connection is cancelled. To prevent accidental disconnections and any loss of work progress, it is recommended to define a value at which the user receives a new session. Since longer sessions would affect load balancing, the duration of each session in oneclick™ is limited to a maximum of 2 hours.

Therefore, make sure that the value stored on the corresponding Windows server is the same as the one you define in oneclick™ under the setting "Sticky user sessions".

Load balancing settings of a destination pool with the Sticky user sessions drop-down list opened

Session hosts in a domain

If your session hosts are members of a domain, set these settings for all of them at once with a process with the task Configure Remote Desktop Session Hosts via group policy. In the task, set Disconnected session limit (minutes) to the same value as under "Sticky user sessions" and Single session per user to Yes. Then run gpupdate /force on the session hosts. The following steps apply to individual servers without a domain.

First, open the "Group Policy Editor" on your server:

  1. Start the execution window by pressing Win + R.
  2. Type gpedit.msc in the execution window and press OK. Run window with gpedit.msc entered and the OK button highlighted
  3. The Local Group Policy Editor opens on your system.

 

1. Set time limit for disconnected sessions in Windows​

  1. Navigate to the following location:
    Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits

  2. On the right side you will find a list of options. Double-click on Set time limit for disconnected sessions, to open a new window. Local Group Policy Editor with the Session Time Limits folder and the Set time limit for disconnected sessions policy highlighted

  3. By default the session is set to "Not configured". Double-click on this entry and change the selection to "Enabled".

  4. Then click OK to confirm your entries. In the now opened window you will see the option "End a disconnected session" on the bottom left side. Set this value to the required time so that any user whose connection has been disconnected will be logged out after this period has passed.

  5. Then click OK to confirm your entries. Set time limit for disconnected sessions policy set to Enabled with End a disconnected session set to 1 hour

 

2. Activate "End session when time limits are reached"​

  1. Stay in the "Session Time Limits" folder (see 1.1).
  2. On the right side, double-click End session when time limits are reached. Session Time Limits folder with the End session when time limits are reached policy highlighted
  3. In the now opened window, check the "Enabled" option and click on OK to confirm your entries. End session when time limits are reached policy set to Enabled

 

3. Restrict users to one Remote Desktop Services session​

  1. Go back to the parent folder Remote Desktop Session Host and click on Connections.
  2. On the right side, you will find a list of different options. Scroll down until you find "Restrict Remote Desktop Services users to a single Remote Desktop Services session". Connections folder with the Restrict Remote Desktop Services users to a single Remote Desktop Services session policy highlighted
  3. Double-click this option and a new window will appear.
  4. Check the "Enabled" option and click on OK to accept your entries. Restrict Remote Desktop Services users to a single Remote Desktop Services session policy set to Enabled From now on, the user can only connect to one single session and – after disconnecting – will continue to have access to his work status for the previously set time without creating multiple open sessions.

 

4. Enable policies​

  • Restart the server.
  • Or, open Microsoft PowerShell and enter the following command:
    gpupdate /force
    The policies are now updated without a restart.