Automatically end RDP session after a certain time

RDP (Remote Desktop Connections) connections do not normally close automatically. Under certain circumstances, however, it may be useful or necessary for Remote Desktop connections to close automatically after a certain period of remote access .

Microsoft has introduced a registry key for this , which defines exactly this automatic closing of the RDP connection according to time . To do this, you have to call up the following registry path in the registry editor.

HKEY_CURRENT_USER Software Policies Microsoft Windows NT Terminal Services

If the ” Terminal Services ” folder does not exist, you simply have to create the key below ” Windows NT “.

The registry value must then be in this folder

MaxConnectionTime

be created as a DWORD 32-bit value. We have shown you this once below.

MaxConnectionTime

In this new value ” MaxConnectionTime ” you can now specify the time after which the seconds or minutes after which the RDP connection should be terminated automatically . Please note that this entry must be made in milliseconds . A minute has 60,000 milliseconds, an hour even  3,600,000  milliseconds.

It is also important to ensure that you enter the value as a ” decimal value “.

Windows then displays the following information message to the RDP user exactly at the expired time period .

Registration timer expired

The exact message is:

Login timer expired
session timed out ,
session terminated in 2 minutes.
Now save all files.

Windows therefore still gives the user an additional 2 minutes of waiting time to properly close the active RDP connection and, if necessary, to save files that are still open so that there is no data loss. After the 2 minutes, however, the RDP session is ended immediately.

We have reported on RDP connections several times in the past . Below is a list of the most popular RDP posts on Windows FAQ.

– End RDP sessions with RWINSTA
– The requested operation could not be carried out because the remote desktop services are currently busy
– Mirror RDP session
– RDP message – A user
account restriction prevents your registration … – Use and provision of virtual desktops (RDP, VDI and DaaS)
– Change standard RDP port 3389
– close RDP sessions remotely and call up an overview of all RDP sessions with “quser”
– activate RDP in Windows 10
– switch drive redirection during RDP session
– restart PC with Windows 10 during RDP session ( shutdown )
– Prevent RDP for local administrators
– Remote desktop connection (RDP) with MSTSC and its parameters
– Activate remote desktop using the registry key – Remote desktop
settings now also in Windows 10 Settings app (Fall Creators Update 1709)
– Run CMD prompt remotely via WINRS

administrator