RDP Session Disconnected - Reason Code 18

Jeremy King 116 Reputation points

Hi. I have a user RDP'ing to a desktop (Windows 10 21H1, up to date with all patches) via remote VPN, which generally works ok - but today he reported he was kicked out and could not reconnect. The message he got on the MSTSC client was:
"Your Remote Desktop Service session has ended, possibly for one of the following reasons:
The administrator has ended the session.
An error occurred while the connection was being established.
A network problem occurred."

Some initial testing (disconnecting and restarting VPN, connecting to other services etc) eliminated any obvious network issues, and I was able to RDP to the PC myself so it was evidently happy on the network too.
When I connected I looked in the event log (TerminalServices-LocalSessionManager log) and could see a number of Event ID 40 (session disconnected) events, which tied into the timing of the user's attempts to reconnect.
The test in the events reads "Session 2 has been disconnected, reason code 18". I've searched and searched but cannot find any information on what "reason code 18" means. can't find any definitions above 12. Can anyone help?

  • incidentally, in the end I rebooted the PC and that resolved the immediate issue so the user could reconnect, but still would like to find out the root cause if possible.


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