Skip to main content

How to Keep Your Windows Server 2022 Session Active Indefinitely

To prevent Remote Desktop sessions from timing out on Windows Server 2022, you can adjust session time limit policies.

Updated yesterday

Step-by-Step: Configure Session Time Limits via Group Policy

Step 1 — Open the Start Menu

Click the Start Menu or press the Windows key.

In the search bar type:

group

Then click Edit group policy.

Screenshot (For search method)

Can include with Windows + R or mac command + R and then typing CMD

optional*

Step 2 — Open the Local Group Policy Editor

The Local Group Policy Editor window will open.

You will see on left several folders

Screenshot: ( Window with Local Group Policy Editor)

Step 3 — Expand Administrative Templates

In the left panel:

  1. Click Computer Configuration
    Below will show more folders

  2. Expand Administrative Templates

Screenshot: (WIth Administrative Templates selected/expanded)

Step 4 — Open Windows Components

Inside the expanded Administrative Templates, scroll down and look for and click:

Windows Components

Screenshot: (With Windows Components selected)

Step 5 — Navigate to Remote Desktop Services

Scroll down until you find:

Remote Desktop Services

Expand it and click:

Remote Desktop Session Host

Screenshot: (With both Remote Desktop Services and Remote Desktop Session Host Expanded)

Step 6 — Open Session Time Limits

Click:

Session Time Limits

You will now see several policy settings related to session timeouts.

Screenshot: ( with session time limits open)

Step 7 — Edit the Disconnected Session Setting

Double-click:

Set time limit for disconnected sessions

Right click on “Set time limit or Disconnected Session” and then click edit

OR

Left click and then click on the left Policy setting

Screenshot: (policy window open with edit)

Step 8 — Enable the Policy

  1. On the left Select from Not Configured to Enabled
    Once this is done, the option on the bottom “End a disconnected session” is now able to be edited.

  2. Make sure that the option is left on: Never

  3. Click Apply

  4. Click OK

Screenshot: Not enabled

Screenshot with enabled:

This will be repeated on these three

  • Set time limit for disconnected sessions

  • Set time limit for active but Idle Remote Desktop Services sessions

  • Set time limit for active Remote Desktop Sercices sessions

Step 9 — Open Command Prompt

After enabling the Policy

Open the Start Menu again and search:

Command Prompt

-Alternate steps

Windows key + R type cmd in the run window ( on mac command + R then type CMD)

Screenshot ( Menu with command prompt)

Step 10 — Update the Group Policy

Run this command:

gpupdate /force

Press Enter.

Screenshot: (Typing command)

You should see:

Computer Policy update has completed successfully.

User Policy update has completed successfully.

Screenshot: (with updated policy completed succesfully)

Result

Your Windows Server session will now remain active indefinitely, even if you disconnect from Remote Desktop.


🤝 Need Assistance?

If any part of the setup feels unclear, the QuantVPS team is happy to help. If you’d like us to verify your environment from our side, feel free to open a support ticket and get connected with the team: https://www.quantvps.com/

Did this answer your question?