Not all codes are enumerable from the COM method shown below. The RDP client disconnect codes are written to the 'Microsoft-Windows-TerminalServices-RDPClient/Operational' event login 'Applications and Services Logs/Microsoft/Windows' in Event Viewer. Please see parent article Remote Desktop Services RDS Logon Connectivity Overview for additional information. This article contains most of the current Remote Desktop Client disconnect codes and reasons.