Cannot reconnect to remote app, mstsc.exe stuck

Gergely Szabó 10 Reputation points
2025-02-04T10:31:36.3866667+00:00

When a RemoteApp session become disconnected e.g. idle timeout the user cannot reconnect. If he close the rdp window to start a new connection he cannot because in the background the mstsc.exe still running blocking the user to start it again. The only way we found is to end the mstsc task from task manager which is quite inconvenient. It is under Windows 11. Does anyone experience the same?
The server is a Windows server 2022 with RDS role, remote apps, and terminal gateway.

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,744 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zunhui Han 3,885 Reputation points Microsoft External Staff
    2025-02-05T16:08:09.57+00:00

    Hello,

    When a RemoteApp session is disconnected, it often remains in a disconnected state rather than being fully terminated. This is designed to allow faster reconnection for subsequent RemoteApps by reusing the existing session rather than creating a new one. However, if the mstsc.exe process is still running in the background, it can prevent users from initiating a new connection.

    In addition to shutting down mstsc.exe through the task manager, you can also try the following two workarounds.

    To prevent sessions from disconnecting due to idle timeout, you can adjust the session timeout settings on the Windows Server 2022 RDS role.

    Open the Local Group Policy Editor by typing gpedit.msc in the Run dialog and pressing Enter.

    Navigate to Computer Configuration\Administrative Templates\Windows Components\Remote Desktop Services\Remote Desktop Session Host\Session Time Limits.

    Find the setting related to session timeouts and configure it to your desired values.

    Restart the Remote Desktop Services

    Restarting the Remote Desktop Services on the server may clear out any stuck sessions and allow users to connect again. This can be done through the Services snap-in in the Microsoft Management Console (MMC).

    I hope the information above is helpful.

    Best regards

    Zunhui

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.