How can I force the server to log off idle RDP session automatically? An idle or inactive session will also consume precious CPU resources and memory. When the number of concurrent connections has reached the limit, your best bet is to kick out idle users. In this tutorial we’ll show you how to use group policy to configure Windows to automatically log off idle remote desktop sessions.
- By default, remote desktop is disabled in both desktop versions of Windows and in Windows Server. How to Enable Remote Desktop Remotely Using PowerShell. Suppose you want to remotely enable RDP on Windows Server 2012 R2/2016/2019. Here is the procedure to achieve the same.
- Each user or device accessing a licensed Windows Server requires a Windows Server CAL or a Windows Server and a Remote Desktop Services (RDS) CAL. With the User CAL, you purchase a CAL for every user who accesses the server to use services such as file storage or printing, regardless of the number of devices they use for that access.
Automatically Log off Idle Remote Desktop Sessions in Windows
In this blog post we will discuss on Installing and Configuring a Remote Desktop License Server (RDS CALs) on Windows server 2019. We can also use same steps if we have windows 2016 or 2012. The steps are almost identical on each windows server editions. There is no noticeable changes in the Steps we follow for any of these Windows Server Editions.
- Open the Local Group Policy Editor and browse to:
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits
In the right panel, double-click the “Set time limit for active but idle Remote Desktop Services sessions” policy.
- Change it to Enabled, then set the desired amount of time in the drop-down list right below. Click Apply and then OK. Reboot your computer to put the policy into effect.
- When any RDP user is idle for the group policy specified amount of time, they will receive the following warning:
“Session has been idle over its time limit. It will be disconnected in 2 minutes. Press any key now to continue session.”
You have the chance to click OK to extend the session. Otherwise, the idle session will log off automatically two minutes later.
That’s it!
Related posts:
In some cases, when connecting to remote computers/RDS server via RDP, users may encounter an “An internal error has occurred” error. This error may appear due to various reasons related to both the settings of the RDP/RDS server and the client (Windows settings, or settings in the Remote Desktop Connection window).
The error “An internal error has occurred” usually appears after user credentials is entered in the mstsc.exe window or immediately after clicking the Connect button.
Since there may be several causes for this RDP error, try to use the following tips one by one until you find a solution that helps you.
The easiest way to fix the problem is to reboot the remote RDP/RDS server and your computer from which you are establishing RDP connection. If you cannot restart the server right now, you should try to restart the Remote Desktop Service. You can do this with the following commands running in the elevated cmd.exe:
Or you can restart Remote Desktop Services from the services.msc console.
Open the properties of your RDP connection in Remote Desktop Connection windows and make sure the ‘Reconnect if the connection is dropped‘ option is enabled on the Experience tab
READ ALSOConfig Remote Desktop Easy Print on Windows Server 2016/2012 R2Next, try to recreate the RDP certificate:
- Open local computer certificates MMC snap-in, by running the certlm.msc command;
- Go to the following certificate section: Remote Desktop > Certificates;
- Right click your self-signed certificate RDP cert and delete it (if there are several RDP certs, remove them all);
- Restart the Remote Desktop Services as described above.
You can try to change the maximum outstanding connections limit on your RDP server via the registry. Set the following registry value via regedit.exe:
Or with PowerShell:
Check the current MTU size oy your Windows with the command:
How To Guide Deploying Remote Desktop Services On Windows ...
If the current MTU size for your network interface is equal or more than 1500 (default Windows value), reduce it by using the command:
Try to change some Group Policy setting using the Local GPO editor (gpedit.msc) or domain Group Policy Management Console (gpmc.msc).
- Disable UDP protocol for RDP connection on clent side: Computer configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client > Turn Off UDP on Client = Enabled;
- Enable FIPS compliant algorithms: Computer configuration > Windows Settings > Security Settings > Local Policies > Security Options > System cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing = Enabled;
- Disable the hardware encoding and enforced AVC:444 mode on the RDP server side: Computer configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment > Prioritize H.264/AVC 444 Graphics mode for Remote Desktop Connection = Disabled;
- Try to change the RDP security level to RDP mode (use the policy ‘Require use of specific security layer for remote connections’ according to the
After changing the policy settings, you need to apply them on the client and server using the

Now check that your RDP client connects without errors.
AuthorRecent PostsCyril KardashevskyI enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.Latest posts by Cyril Kardashevsky (see all)Remote Desktop Windows Server 2019 Activation
Remote Desktop Windows Server 2019 Black Screen

Comments are closed.