Skip to main content

RemoteApp sessions: Log off immediately and allow multiple sessions

This article applies to multi-user environments with Remote Desktop Session Host (RDSH) where you deliver remote apps.

When a user closes a remote app in oneclick™, the associated Windows session is not automatically logged off. The connection may be disconnected while the session remains active on the server. When the user launches another remote app, Windows may reuse the existing session.

You can configure two different scenarios using Group Policy on the Remote Desktop Session Host:

  • Log off a RemoteApp session immediately after closing: Prevent a disconnected session from being reused when another remote app is launched.
  • Allow multiple Windows sessions for the same user: Enable a user to run several independent Remote Desktop sessions simultaneously on the same session host.

Important: Multiple remote apps can also run simultaneously within the same Windows session. You do not need to allow multiple sessions per user for this.

Open Group Policy​

You need administrator rights on the session host or permission to edit the corresponding Group Policy Object (GPO) to configure the following settings.

  1. On the session host, press Win + R.
  2. Enter gpedit.msc.
  3. Press Enter.

The Local Group Policy Editor opens.

Active Directory

If you manage your session hosts centrally through Active Directory, use Group Policy Management instead of the Local Group Policy Editor. Link the Group Policy Object (GPO) to the organizational unit (OU) containing your session hosts.
Note the difference between the policy paths:

  • Local Group Policy Editor: Computer Configuration > Administrative Templates
  • Domain GPO: Computer Configuration > Policies > Administrative Templates

The remaining paths to the individual settings are identical.

Existing group policies

This guide uses Computer Configuration. Check whether other Group Policy settings for session time limits are already configured and could affect the intended behavior.

1. Log off a RemoteApp session immediately after closing​

Use this setting if a disconnected RemoteApp session should be logged off as quickly as possible. The user can then start a new session instead of reconnecting to the disconnected session.

  1. Under Computer Configuration > Administrative Templates, navigate to Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits. Local Group Policy Editor with Remote Desktop Session Host and the Session Time Limits folder highlighted
  2. Double-click Set time limit for logoff of RemoteApp sessions. Session Time Limits folder with the Set time limit for logoff of RemoteApp sessions policy highlighted
  3. Select Enabled.
  4. Set "RemoteApp session logoff delay" to Immediately.
  5. Click Apply, then OK. Set time limit for logoff of RemoteApp sessions policy set to Enabled with logoff delay Immediately
  6. Next, double-click End session when time limits are reached.
  7. Select Enabled.
  8. Click Apply, then OK. End session when time limits are reached policy set to Enabled

Please note: After all RemoteApp windows and all notification area icons started by the user have been closed, the session remains active for another 20 seconds. If the user does not launch another remote app during this time, Windows disconnects the session. The configured logoff delay then takes effect. With the Immediately setting, Windows logs off the session without any additional delay.

For more information, see the Microsoft documentation.

Potential data loss

Logging off a RemoteApp session may cause unsaved changes in running applications to be lost. Test this behavior before using the configuration in production and inform the affected users.

2. Allow multiple separate sessions per user​

If a user needs multiple independent Remote Desktop sessions on the same session host, you can allow them through Group Policy.

  1. Under Computer Configuration > Administrative Templates, navigate to Windows Components > Remote Desktop Services > Remote Desktop Session Host > Connections.
  2. Double-click 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. Select Disabled.
  4. Click Apply, then OK. Restrict Remote Desktop Services users to a single Remote Desktop Services session policy set to Disabled
  5. Next, double-click Limit number of connections.
  6. Select Enabled.
  7. Under "RD Maximum Connections allowed", enter a sufficiently high value, for example 999999.
  8. Click Apply, then OK. Limit number of connections policy set to Enabled with the value 999999

Please note: The value 999999 allows an unlimited number of connections at the Group Policy level. Other restrictions of the RDS deployment may still apply.

Disabling the single-session restriction allows additional Windows sessions. However, it does not mean that Windows automatically starts each remote app in a separate session. Additional sessions also increase the load on the session host.

Single-session restriction

In the article Time limit for disconnected sessions, the single-session restriction is enabled instead. These settings are mutually exclusive. Decide whether you want to allow one or multiple sessions per user.

3. Apply Group Policy settings​

You have two options to apply the changed settings on the session host:

Update Group Policy

  1. On the session host, open PowerShell or Command Prompt as an administrator.
  2. Run the following command:
    gpupdate /force
  3. Verify the applied Group Policy settings and test the behavior with a newly established Windows session.

Alternatively: Restart the server

Restart the session host to reapply Group Policy settings during system startup.

Server restart

Restarting the server interrupts all active user sessions. Inform the affected users and schedule the restart outside regular usage hours whenever possible to avoid data loss.

Which setting fits your goal?​

GoalRelevant instructions
Log off a disconnected RemoteApp session as quickly as possible after closingSection 1
Run multiple remote apps simultaneously within the same sessionNo changes to the single-session restriction required
Allow multiple separate Windows sessions per userSection 2
Limit the duration of disconnected sessions in combination with load balancing and restrict users to a single sessionTime limit for disconnected sessions
Keep processes running on the server after closing the application windowStop disconnection