Windows Server Remote Desktop Session Host disconnecting clients

Marcel Körbler 0 Reputation points
2025-03-26T14:08:45.5066667+00:00

We are using Windows Server 2022 as a remote desktop session host, with session based remote connections and have the issue, that the remote sessions are randomly disconnected to our freerdp based clients.

When exploring the windows protocol we notice one particular information message that seems to relate to our issue:

Event ID: 39 Message: Session "17" has been disconnected by session "0"

The first session is the session that dropped the connection, the second one is always "0". We understand session "0" as being the root/windows session. But the question is, why does the root session kill our client session randomly?

The error on the client side looks like:

[15:06:14:485] [469455:000729dc] [INFO][com.freerdp.core] - [rdp_print_errinfo]: ERRINFO_RPC_INITIATED_DISCONNECT (0x00000001):The disconnection was initiated by an administrative tool on the server in another session.

Windows Server Remote and virtual desktops Remote desktop services and terminal services
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Marcel Körbler 0 Reputation points
    2025-03-27T10:03:18.12+00:00

    After a night of debugging we found the answer: It was the smart card removal policy that created the issue. We first ruled it out because the disconnects even happened on clients without smart cards but in the end, the smart card service was the culprit. Which in hindsight makes perfect sense, it is a service that lives in session "0" and is disconnecting other session when it detects a smart card removal.

    We can't explain why it malfunctioned that often, killing session with the smart card still attached or sessions without smart cards at all but disabling the policy fixed the issue. We now detect a removed smart card on the client side and kill the freerdp session accordingly.

    0 comments No comments

  2. Mars Shan-MSFT 1,085 Reputation points Microsoft External Staff
    2025-03-28T01:12:57.1666667+00:00

    Hello,

    Since freerdp is a 3rd party application, it is hard to give you a official suggestion. You can use standard rdp(mstsc) and confirm if there is any issue.

    You can also update your freeRDP in case it is a software bug.


    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.