3.5.1 RDP Client Logoff from RD Session Host
This example demonstrates the process of disconnecting an RDP client from an RD Session Host as described in section 2.5.3.1.
Prerequisites
Licensing, authentication, authorization, and DNS services are available. A connection exists between the RDP client and RD Session Host.
Initial System State
The RDP client and RD Session Host are connected.
Final System State
The RDP client and RD Session Host are disconnected.
Sequence of Events
The disconnecting sequence is illustrated in the following diagram.

Figure 13: Sequence of RDP client logging off from RD Session Host
The following steps describe one particular example of this sequence:
The user attempts to log off the remote desktop.
After logging off the remote desktop, the RD Session Host communicates the reason for termination to the client by carrying out the following optional actions in sequence ([MS-RDPBCGR] section 1.3.1.4.2):
Sending a Set Error Info PDU ([MS-RDPBCGR] section 2.2.5.1.1) containing the error code 0x0000000C (ERRINFO_LOGOFF_BY_USER).
Sending an MCS Disconnect Provider Ultimatum PDU ([MS-RDPBCGR] section 2.2.2.3) with the reason code set to "user requested".
The RD Session Host terminates the user session and cleans up resources associated with the session.