Remote Desktop Connection Error Code 0x904 Extended Error - Code 0x7 Full _verified_
Troubleshooting Guide: Remote Desktop Connection Error Code 0x904 (Extended Error Code 0x7)
Article Difficulty: Advanced / System Administrator Level
Estimated Reading Time: 8 minutes
Fix 1: Force TCP Only (Bypass UDP)
This is the fastest workaround. If the error is related to UDP transport, forcing TCP will resolve it immediately.
Steps:
- Open your RDP client (
mstsc.exe).
- Click Show Options.
- Go to the Experience tab.
- Uncheck "Use persistent bitmap caching" (optional) and ensure "Reconnect if connection is dropped" is checked.
- Close the dialog.
- Open Group Policy Editor (
gpedit.msc) or Registry:
- Navigate to:
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Connection Client
- Enable: "Turn off UDP on client"
- Alternatively, create a DWORD:
HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services\Client\fClientDisableUDP = 1
- Reboot and retry the connection.
Enable RDP Client Logging
- Open Registry Editor.
- Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
- Create a new DWORD:
RDGClientTrace with value 15 (hex).
- Create a new String:
RDGClientTraceFile with value C:\temp\rdp_trace.txt.
- Reproduce the error.
- Open the trace file. Search for
0x904 and 0x7. You will see the exact HTTP response code (e.g., 400 Bad Request, 502 Gateway Error).
Understanding the Error
-
Error Code 0x904: This is a generic error code that can occur during a Remote Desktop Connection. It usually indicates a problem with the connection that prevents it from being established.
-
Extended Error Code 0x7: This provides more specific information about the error. In many cases, error codes are HRESULT values, which can be looked up. However, the meaning can be somewhat generic or specific to a component. Open your RDP client ( mstsc
Fix 3: Disable SSL Inspection for RDP Traffic (Firewall Fix)
If you control the network firewall:
- Add an SSL inspection bypass rule for the destination RD Gateway IP or FQDN.
- Alternatively, exclude port 443 (HTTPS) and port 3391 (UDP RDP) from deep packet inspection.
- If using a personal firewall (Windows Defender), temporarily disable "Block all incoming connections" and "Stealth mode".
Fix 4: Clear RD Gateway Credentials
Corrupted credentials frequently cause extended error 0x7. SSL certificate mismatches
- Open Control Panel > User Accounts > Credential Manager.
- Click Windows Credentials.
- Find any entries starting with
TERMSRV/ or RDG:.
- Click Remove for all remote desktop related entries.
- Open Command Prompt as Administrator and run:
cmdkey /list
cmdkey /delete:TERMSRV/your-server-name
- Reconnect to RDP—you will be prompted for fresh credentials.
Diagnostic commands
- PowerShell: Test-NetConnection -ComputerName -Port 3389
- nslookup
- netstat -ano | findstr 3389 (on server)
- Get-Service -Name TermService (PowerShell) to check Remote Desktop Services
Introduction
Few things are more frustrating for IT administrators and remote workers than a cryptic error message blocking access to a critical machine. If you are reading this, you have likely encountered the dreaded Remote Desktop Connection error code 0x904 accompanied by the extended error code 0x7 full message.
Unlike common RDP errors (like 0x4 or 0x516), this specific combination is relatively rare and points toward deep-seated issues with the Remote Desktop Gateway (RD Gateway), SSL certificate mismatches, or UDP transport failures. Many online forums leave users at a dead end, stating "reinstall Windows" or "check your network." why they appear together
This article provides a comprehensive, step-by-step forensic analysis of what error codes 0x904 and 0x7 actually mean, why they appear together, and exactly how to fix them without reinstalling your OS.
Common causes
- Network connectivity issues between client and host or between client and RD Gateway.
- DNS resolution failures for the remote host or gateway.
- Incorrect Remote Desktop client configuration (wrong server name, port, or gateway).
- RD Gateway or Remote Desktop Services role misconfiguration.
- Firewall blocking RDP/TCP 3389 or gateway-specific ports.
- Expired or invalid SSL/TLS certificate on RD Gateway or RD Web/Connection Broker.
- Authentication/credential issues (cached/invalid credentials, domain trust problems).
- Group Policy or security settings requiring Network Level Authentication (NLA) while client lacks support or configuration.
- Remote host not joined to domain or unavailable for user session assignment (in RD Session Host / VDI scenarios).