0x7 | Remote Desktop Connection Error Code 0x904 Extended Error Code
If you've tried all of these steps and the error persists, the issue may be more specific and requires a different approach.
Scroll down the left sidebar menu to the section and select Run command . Choose RunPowerShellScript from the menu options.
This specific sub-code points directly to a Gateway or Network Layer issue . In Microsoft's Remote Desktop Protocol (RDP) documentation, an extended error of 0x7 usually translates to "The connection was lost due to a network error" or a failure to authenticate through a Remote Desktop Gateway. If you've tried all of these steps and
: Windows auto-generates a self-signed certificate for TLS RDP tunnels. If this certificate expires or the local MachineKeys directory becomes corrupted, the handshake fails immediately.
In secure environments utilizing hardened policies (such as CyberArk PSM or defense-in-depth frameworks), the local NETWORK SERVICE account might lose permission to access its own cryptographic keys. This blocks the creation of the underlying TLS tunnel. This specific sub-code points directly to a Gateway
Log into the target server locally or via an alternative administration tool (e.g., Windows Admin Center or hypervisor console).
The self-signed certificate used by Remote Desktop Services has expired and failed to renew automatically. If this certificate expires or the local MachineKeys
: Download the official Microsoft Remote Desktop app from the Microsoft Store. This app relies on a modern sandboxed network stack unaffected by the mstsc.exe security bugs. 5. Standardize Firewall and Security Software Exceptions
The Remote Desktop Connection error code 0x904 with an extended error code of 0x7 indicates a problem with establishing a remote desktop connection to a Windows-based computer. This error typically occurs when the client attempting to connect to the remote desktop is unable to negotiate a secure connection.
Launch mmc.exe as an administrator, go to , select Certificates , choose Computer Account , and click Finish . Navigate to Personal > Certificates .
Quick targeted fixes by root cause