I'm connecting to one windows server 2019 from another windows server 2019 through RDP, when i close the connection using the "X" button and then try to open new RDP connection i get a timeout on this new RDP, however on the other hand if i "logout" on the first RDP connection and then try open new RDP then the connection goes fine, it seems that closing RDP by clicking "X" button doesnt really trigger a "logout" and so i'm unable to login again, what configuration can be changed to make the "X" trigger a logout? or any workaround to overcome this, its inconvenient to use the "logout" everytime i get out
1 Answers
You are looking at the wrong side of the problem. Yes, clicking the X on a RDP connection causes the user session to turn into disconnected state: All applications remain running, so that the user can return to the last state once he logs back in.
If I were you, I would try to figure out, what is causing the timeout. From your tags, I assume you are using a remote desktop gateway? That is probably where your problems come from.
But to answer your question, you could install easily a group policy (either via local group policy editor or via GPO on your domain controller) to end disconnected sessions after a certain amount of time (minimum is 1 minute).
You find this group policy in the following path:
Computer Configuration/Administrative Templates/Windows Components/Remove Desktop Services/Remote Desktop Session Host/Session Time Limits
"Set time limit for disconnected sessions"
But beware! If a user clicks on the X, and has unsaved work - there will not be any warning, and all unsaved work will be lost...

- 2,194
- 7
- 16