Requirements

  • Windows Server 2016 or earlier
  • Local administrator

Sometimes when a RDP user closes the client instead of logging out, the RDP session will remain in an inactive state.

Use query user to list sessions. If the state of the session is “Disc”, then we can attach to it. Using the current session’s session name (e.g. rdp-tcp#6), we use tscon to attach the RDP session (detached session ID 3) to our current graphics session (rdp-tcp#6).

tscon 3 /dest:rdp-tcp#6