{"id":779,"date":"2026-09-21T22:45:33","date_gmt":"2026-09-21T22:45:33","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=779"},"modified":"2026-09-21T22:45:33","modified_gmt":"2026-09-21T22:45:33","slug":"fix-rdp-idle-session-timeouts-windows-server","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/","title":{"rendered":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A remote desktop session that drops after a fixed interval of inactivity is almost never a network fault. It is a policy \u2014 either a Group Policy timeout on the server, a session limit on a Remote Desktop Session Host, or a stateful firewall that forgets an idle TCP flow. Each cause leaves a different trace, and the fix is different for each.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This walks through the diagnostics in the order that eliminates possibilities fastest, from the server-side policy that is easiest to check to the network layer that is hardest to prove. It assumes a standard Windows Server host rather than an RDS farm, though the same event IDs apply when <a href=\"https:\/\/windows-vps.org\/\">our Windows VPS comparison table<\/a> is used to pick a session-capable instance.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Separate disconnect from lock from logoff<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The three outcomes look similar to a user and are configured separately. A <em>disconnect<\/em> leaves the session alive on the server and reconnecting resumes it exactly. A <em>lock<\/em> keeps the session connected but requires the password again. A <em>logoff<\/em> destroys the session and any unsaved work with it. If users complain about lost work, you are dealing with a logoff, and the relevant settings are time limits rather than idle detection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Per-session timeout policy on the local machine \/ RDS host\nGet-ItemProperty 'HKLM:\\SOFTWARE\\Policies\\Microsoft\\Windows NT\\Terminal Services' |\n  Select-Object MaxIdleTime, MaxDisconnectionTime, MaxConnectionTime, fResetBroken<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Values are in milliseconds. <code>MaxIdleTime<\/code> is the setting that produces the classic drop-after-twenty-minutes behaviour. A value of 0 means no limit; an absent property means the policy is not applied at all, which points you toward the Group Policy object instead of the local registry.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Check Group Policy before editing the registry<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the registry keys above exist under <code>SOFTWARE\\Policies<\/code>, something is enforcing them, and the local machine will overwrite your manual edits at the next policy refresh. Trace the setting to its source in the GPO that applies to the server, and change it there or link a policy with the intended value. Common culprits are an RDS session-collection policy template that was applied during setup and then forgotten.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>Set time limit for active but idle Remote Desktop Services sessions<\/em> \u2014 the idle disconnect.<\/li>\n<li><em>Set time limit for disconnected sessions<\/em> \u2014 how long a disconnected session is kept before logoff.<\/li>\n<li><em>End session when time limits are reached<\/em> \u2014 turns a timeout into a logoff, which is often what surprises people.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Rule out the keep-alive and the network path<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RDP sends periodic keep-alive traffic so stateful devices do not expire the flow. If the interval is longer than the idle timeout on a NAT device or load balancer in the path, the flow is silently dropped and the client sees a disconnect even though the server never timed out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Inspect and shorten the keep-alive interval\nGet-ItemProperty 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server' |\n  Select-Object KeepAliveEnable, KeepAliveInterval\n# Typical values: KeepAliveEnable = 1, KeepAliveInterval = 1 (minutes)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Confirm the direction of the fault by watching the server&#8217;s own event log for session disconnects at the moment the client drops. If the server logs a normal disconnect at the same timestamp, the server believes the client went away; if it logs nothing, the client lost the path. That single check splits policy problems from network problems reliably.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Read the event log properly<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two channels carry the evidence. <em>Microsoft-Windows-TerminalServices-LocalSessionManager\/Operational<\/em> logs session creation, reconnection, and disconnection with the event IDs you need. <em>Microsoft-Windows-TerminalServices-RemoteConnectionManager\/Operational<\/em> logs the connection attempts themselves.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-WinEvent -LogName 'Microsoft-Windows-TerminalServices-LocalSessionManager\/Operational' -MaxEvents 40 |\n  Where-Object { $_.Id -in 21,22,23,24,25,39,40 } |\n  Select-Object TimeCreated, Id, Message<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Event ID 24 is a disconnect, 25 a reconnection, and 21 a successful logon. A pattern of 24 with no 25 means the client stopped reconnecting, which is usually a network path or a client-side sleep setting rather than a server policy. Event 39 and 40 relate to session logoff and removal, and they confirm whether a timeout ended the session for good.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set values that match how the server is used<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An interactive administrator session benefits from generous idle limits because a human steps away. A shared RDS host with many users needs tighter limits to release resources, but the limit should be measured against real usage rather than copied from a hardening baseline. If a session must survive a laptop sleeping, lengthen the disconnected-session timeout and confirm the firewall does not expire the flow before the timeout fires.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test the change with the actual client devices rather than a single workstation performance test. A setting that works on a wired desktop with a keep-alive every minute can still drop on a mobile hotspot that reassigns addresses between towers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A diagnostic order that converges<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Check the effective timeout policy with the registry query above.<\/li>\n<li>If the keys are policy-managed, find the GPO and change it at source.<\/li>\n<li>Verify keep-alive is enabled and shorter than any intermediate idle timeout.<\/li>\n<li>Correlate the disconnect time with TerminalServices event log entries.<\/li>\n<li>Only then suspect the network, and prove it by comparing log timestamps on both sides.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Work through that order and the drop-outs either stop or turn into a specific, fixable defect. Reviewing the settings in that sequence is faster than guessing, and it leaves a documented reason for whatever value you finally set. If the disconnects trace back to an undersized instance rather than a policy, <a href=\"https:\/\/windows-vps.org\/\">see the full specs and pricing<\/a> to see which tiers support the concurrent session count you need.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A remote desktop session that drops after a fixed interval of inactivity is almost never a network fault. It is a policy \u2014 either a Group Policy timeout on the server, a session limit on a Remote Desktop Session Host, or a stateful firewall that forgets an idle TCP flow. Each cause leaves a different &#8230; <a title=\"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\" aria-label=\"Read more about Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-779","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings - Windows VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings\" \/>\n<meta property=\"og:description\" content=\"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-21T22:45:33+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\",\"name\":\"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-09-21T22:45:33+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings - Windows VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/","og_locale":"en_US","og_type":"article","og_title":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings","og_description":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings","og_url":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-09-21T22:45:33+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"windows-vps","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/","url":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/","name":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-09-21T22:45:33+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/fix-rdp-idle-session-timeouts-windows-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"Fixing Unexpected RDP Disconnects: Idle Timeouts, Session Limits, and Keep-Alive Settings"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=779"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/779\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/779\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}