I Remote Desktop Connection Error Code 0x904 Better
Error 0x904 is annoying but fixable. The registry reset method works ~90% of the time. If you're in a corporate environment, your IT may need to reissue RDP CALs. For personal use, clearing cache + NLA tweak usually resolves it without reinstalling anything.
Rating for Microsoft's error handling: ⭐⭐☆☆☆ (Poor – error messages are vague, forcing registry edits)
Fix effectiveness: ⭐⭐⭐⭐☆ (Good if you follow the steps above)
Would you like a step-by-step PowerShell script to automate the registry fix?
Troubleshooting Remote Desktop Connection Error Code 0x904: A Comprehensive Guide
Are you frustrated with the Remote Desktop Connection error code 0x904? You're not alone! Many users have reported encountering this issue while trying to establish a remote desktop connection. In this blog post, we'll explore the possible causes of error code 0x904 and provide you with practical solutions to resolve it.
What is Error Code 0x904?
Error code 0x904 is a common issue that occurs when trying to establish a Remote Desktop Connection (RDC) to a Windows machine. The error message typically reads: "The remote computer disconnected. The error code is 0x904." This error can occur due to various reasons, including network connectivity issues, incorrect configuration, or problems with the remote desktop software.
Causes of Error Code 0x904
After analyzing various user reports and technical forums, we've identified some common causes of error code 0x904:
Solutions to Resolve Error Code 0x904
Don't worry; we've got you covered! Here are some step-by-step solutions to help you resolve error code 0x904:
Solution 1: Check Network Connectivity
Solution 2: Verify RDC Configuration
Solution 3: Update Remote Desktop Software
Solution 4: Disable Firewall or Antivirus Software
Solution 5: Check Event Logs
Conclusion
Error code 0x904 can be frustrating, but with these solutions, you should be able to resolve the issue and establish a successful Remote Desktop Connection. If you're still experiencing problems, feel free to leave a comment below, and we'll do our best to help you troubleshoot the issue.
Additional Tips
By following these solutions and tips, you should be able to overcome error code 0x904 and enjoy a seamless remote desktop experience.
Remote Desktop Protocol (RDP) error code 0x904 is a connection failure message typically indicating network instability, expired security certificates, or firewall interference. While it often appears alongside "Extended Error Code: 0x7," the root cause usually lies in how the client and server negotiate their secure handshake. The Core Causes of Error 0x904
Expired RDP Certificates: This is the most common "silent" cause. Every RDP host generates a self-signed certificate that eventually expires, causing connections to fail even if network settings remain unchanged.
Network Instability: Low bandwidth, high packet loss, or a sluggish VPN can disrupt the RDP session before it fully establishes.
Credential and Security Mismatches: Discrepancies in encryption ciphers between Windows 11 clients and older servers (like Windows Server 2016/2019) frequently trigger this error.
Azure VM Specifics: On Azure Virtual Machines, a corrupt "MachineKeys" folder can prevent the system from creating the necessary certificates for remote access. Effective Troubleshooting Strategies
To resolve error 0x904, follow these steps in order of effectiveness:
Renew the RDP CertificateIf you have local access to the server, open the Certificates Manager (certlm.msc), find the expired certificate under Remote Desktop > Certificates, and delete it. Afterward, restart the Remote Desktop Services in the Command Prompt as an administrator using restart-service termserv -force. Windows will then automatically generate a fresh certificate.
Fix Azure VM CorruptionIf the error occurs on an Azure VM, use the Azure Portal "Run Command" feature to execute a PowerShell script that renames the corrupt MachineKeys folder to MachineKeys_old and reboots the server.
Adjust Security Layer SettingsUsing the Group Policy Editor (gpedit.msc), you can force the server to use a standard RDP security layer. Navigate to Remote Desktop Session Host > Security and set "Require use of specific security layer for remote (RDP) connections" to Enabled, selecting RDP as the security layer.
Verify Firewall and NetworkEnsure that Remote Desktop (WebSocket) is allowed through the Windows Defender Firewall on both the client and host machines. If using a VPN, ensure it is stable; switching from a computer name to a direct IP address in the connection field can also bypass local DNS resolution issues.
Are you connecting to a local workstation or a cloud-hosted virtual machine? Fixed: Remote Desktop 0x904 Error [2 Solutions] - AnyViewer
Understanding and Resolving Remote Desktop Connection Error Code 0x904
Introduction
Remote Desktop Connection (RDC) is a vital tool for many professionals, allowing them to access and control a remote computer from another location. However, users often encounter errors that hinder their ability to establish a successful connection. One such error is the RDC error code 0x904. This paper aims to provide an in-depth analysis of the error code 0x904, its causes, and effective solutions to resolve the issue.
What is Remote Desktop Connection Error Code 0x904?
The Remote Desktop Connection error code 0x904 is a specific error that occurs when a user attempts to connect to a remote desktop, but the connection fails. The error message typically reads: "The remote computer disconnected. The error code is 0x904." This error can be frustrating, especially for users who rely on RDC for work or personal purposes.
Causes of Remote Desktop Connection Error Code 0x904
Several factors contribute to the occurrence of error code 0x904. Understanding these causes is crucial to resolving the issue:
Solutions to Resolve Remote Desktop Connection Error Code 0x904
To resolve error code 0x904, try the following solutions:
Advanced Troubleshooting Steps
If the above solutions do not resolve the issue, try:
Conclusion
Remote Desktop Connection error code 0x904 can be a challenging issue to resolve, but by understanding its causes and applying the solutions outlined in this paper, users can successfully troubleshoot and resolve the error. Regular maintenance, such as updating software and verifying remote desktop settings, can also help prevent error code 0x904 from occurring in the future. By following these guidelines, users can ensure a seamless and efficient remote desktop connection experience.
Recommendations
Future Research Directions
By continuing to research and understand RDC error codes like 0x904, we can improve the overall remote desktop connection experience and enhance the productivity of users worldwide.
Remote Desktop Connection error (often accompanied by extended error code
typically signals a network-level connection failure caused by expired RDP certificates firewall blocks hostname resolution issues Quick Fixes Connect via IP Address : Instead of using the computer name (e.g., ), use the internal IP address (e.g., 192.168.1.50 ) in the "Computer" field of the Remote Desktop Connection app Use the Microsoft Store App : Users often find that the Microsoft Store version of Remote Desktop bypasses bugs present in the built-in Windows Restart RDP Services
: On the remote machine, open a Command Prompt as Administrator and run: net stop termservice && net start termservice www.remoteaccesspcdesktop.com Advanced Troubleshooting If the quick fixes fail, follow these steps in order: 1. Renew Expired RDP Certificates
Expired self-signed certificates are a primary cause of 0x904 errors. www.remoteaccesspcdesktop.com remote computer certlm.msc , and hit Enter. Navigate to Remote Desktop Certificates Right-click and any expired certificates.
Restart the computer; Windows will automatically generate a fresh certificate upon reboot. www.remoteaccesspcdesktop.com 2. Adjust Firewall Settings
Ensure the firewall isn't blocking RDP traffic on either end: Search Windows for "Allow an app through Windows Firewall." Remote Desktop Remote Desktop (WebSocket) are checked for both If using third-party antivirus (like Bitdefender), add to the exception list. www.remoteaccesspcdesktop.com 3. Fix Certificate Store Corruption (Azure/Advanced) If certificates cannot be generated, the MachineKeys folder may be corrupt. www.remoteaccesspcdesktop.com
: Use the "Run Command" feature in the Azure Portal to run this PowerShell script:
Rename-Item -path "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" -NewName "MachineKeys_old"
: Run the same command in PowerShell as Administrator, then reboot. www.remoteaccesspcdesktop.com 4. Security Layer Configuration
In cases of mismatched encryption, forcing a specific security layer can help. Microsoft Learn Unable to RDP into some Windows Servers - Error code: 0x904 24-Apr-2025 —
Troubleshooting Guide for Remote Desktop Connection Error Code 0x904
Error Overview
The Remote Desktop Connection error code 0x904 typically occurs when there is an issue with the Remote Desktop Protocol (RDP) connection. This guide provides steps to help you troubleshoot and resolve the error.
Step 1: Check the Basics
Step 2: Update Remote Desktop Connection
Step 3: Disable Network Level Authentication (NLA)
Step 4: Check Firewall and Port Settings
Step 5: Run the Remote Desktop Connection Troubleshooter i remote desktop connection error code 0x904 better
Step 6: Reset Remote Desktop Settings
Step 7: Reconnect and Verify
If none of these steps resolve the error, you may want to consider seeking additional assistance from a system administrator or Microsoft support resources.
Troubleshooting Remote Desktop Connection Error Code 0x904 Remote Desktop Protocol (RDP) is essential for modern IT management, but encountering Error Code 0x904 (often accompanied by extended error code 0x7) can bring productivity to a halt. This error typically signifies a failure to establish a secure Transport Layer Security (TLS) tunnel, often due to certificate issues, firewall blocks, or network instability.
If you are facing this issue on Windows 10, Windows 11, or Windows Server, follow these proven solutions to restore your connection. 1. Fix Expired or Corrupt RDP Certificates
The most common cause for error 0x904 is an expired self-signed certificate that the Remote Desktop Service uses for encryption. How to Renew the Certificate:
Log into the affected host locally or through an alternative remote tool.
Press Win + R, type certlm.msc, and hit Enter to open the Local Computer Certificates manager. Navigate to Remote Desktop > Certificates.
Identify the expired certificate, right-click it, and select Delete.
Restart the Remote Desktop Services. Open PowerShell as Administrator and run:Restart-Service termserv -Force.
Windows will automatically generate a new, valid self-signed certificate. 2. Resolution for Azure Virtual Machines (VMs)
For those using Azure, error 0x904 often stems from a corrupt MachineKeys folder, which prevents the system from generating new certificates. The PowerShell Fix:
Go to the Azure Portal, select your VM, and choose Run command.
Select RunPowerShellScript and enter:Rename-Item -path "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" -NewName "MachineKeys_old".
Reboot the VM. The system will recreate the folder and the necessary keys upon startup. 3. Advanced Firewall & Anti-Virus Exceptions
Even if RDP is technically enabled, specific firewall rules or third-party security software (like Bitdefender) might block the mstsc.exe process. Verification Steps:
Manual Exception: Go to "Allow an app through Windows Firewall," click Change settings, and ensure both Remote Desktop and Remote Desktop (WebSocket) are checked for Private and Public networks.
Direct Path: Explicitly add C:\Windows\System32\mstsc.exe to your firewall's allowed list.
Check Port 3389: Run Test-NetConnection [ServerIP] -Port 3389 in PowerShell to confirm the port is reachable. 4. Workarounds for Windows 11 Compatibility
Windows 11 updates occasionally introduce bugs that affect hostname resolution or standard RDP client stability.
Use IP Instead of Hostname: Try connecting using the remote machine's internal or external IP address (e.g., 192.168.1.50) instead of its computer name.
Microsoft Store RDP App: Many users find that the Microsoft Remote Desktop app from the Microsoft Store is unaffected by the bugs hitting the legacy mstsc.exe client. 5. Adjust Security Layers (GPO)
If encryption mismatches are suspected, you can force the server to use a specific security layer via the Group Policy Object (GPO). Unable to RDP into some Windows Servers - Error code: 0x904
Remote Desktop Connection error 0x904 (often accompanied by extended error code 0x7) is a common issue typically caused by network instability, expired RDP certificates, or Windows 11 compatibility bugs. Most Effective Fixes for Error 0x904
Renew Expired RDP Certificates: The most common root cause is an expired self-signed certificate on the remote server.
On the remote server, press Win + R, type certlm.msc, and hit Enter to open Local Computer Certificates. Navigate to Remote Desktop > Certificates.
Check the expiration date of the certificate. If it has expired, delete it.
Restart the Remote Desktop Services by running restart-service termserv -force in PowerShell as an Administrator. Windows will automatically generate a fresh certificate.
Use the IP Address Instead of Hostname: Many users on Windows 11 (specifically builds 22H2 and later) encounter 0x904 due to a bug in hostname resolution.
Instead of entering the computer's name (e.g., "Office-PC"), enter its internal IP address (e.g., 192.168.1.50) in the Remote Desktop Connection window.
Switch to the Microsoft Store RDP App: If the built-in mstsc.exe client continues to fail, the Microsoft Remote Desktop app available in the Microsoft Store often works because it uses a different networking stack that bypasses these specific bugs.
Fix Azure VM Certificate Corruption: If you are using an Azure Virtual Machine, the 0x904 error frequently stems from a corrupt MachineKeys folder. Error 0x904 is annoying but fixable
Access the VM via the Azure Portal and use the Run Command feature to execute the following PowerShell script:Rename-Item -path "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" -NewName "MachineKeys_old".
Reboot the VM; Windows will recreate a healthy folder and fresh certificates.
Grant Private Key Permissions: In advanced environments like CyberArk PSM, the error may occur if the NETWORK SERVICE account lacks read access to the RDP certificate's private key.
In the Certificates MMC snap-in, right-click your certificate > All Tasks > Manage Private Keys, and ensure NETWORK SERVICE has Read permissions. Quick Connectivity Checklist
Check Firewall: Ensure "Remote Desktop" and "Remote Desktop (WebSocket)" are allowed through the Windows Defender Firewall on both the client and host.
Verify RDP Port: Use PowerShell to test if port 3389 is open: Test-NetConnection [TargetIP] -Port 3389.
Network Stability: If connecting over a VPN, ensure you have sufficient bandwidth; high packet loss can trigger this code.
Remote Desktop error code 0x904 (often accompanied by extended error code 0x7) primarily indicates a network connection failure
. It typically occurs when the connection is too unstable to establish a session, often due to insufficient bandwidth, packet loss, or expired security certificates.
Below is a detailed guide to troubleshooting and fixing this error. 1. Fix Expired RDP Certificates
The most common "silent" cause for this error is an expired self-signed certificate on the remote server. If a certificate expires, the client may reject the connection without a clear warning. www.remoteaccesspcdesktop.com Access the Server: Log in locally or via a different remote tool. Manage Certificates: certlm.msc , and hit Enter. Locate Certificate: Remote Desktop Certificates Certificates If the certificate is expired, right-click and Restart Service: Open an elevated Command Prompt and run: restart-service termserv -force
Windows will automatically generate a new, valid self-signed certificate. www.remoteaccesspcdesktop.com 2. Stabilize Network and VPN
Because 0x904 is often a timeout or instability error, your network path must be clear. Check Bandwidth:
Ensure both ends have stable internet. Sluggish VPNs are a frequent culprit. Bypass Hostname: Try connecting using the IP address
of the remote computer instead of its hostname to rule out DNS resolution issues. Restart Equipment:
Simply restarting the host computer or the VPN client can sometimes resolve transient protocol errors. 3. Configure Firewall and Security
Firewalls may block RDP traffic or specific WebSocket protocols required by newer Windows versions. Microsoft Learn Allow the App:
Search for "Allow an app through Windows Firewall" in the Start menu. Enable Features: Ensure both Remote Desktop Remote Desktop (WebSocket) are checked for both Private and Public networks. Exception List: C:\Windows\System32\mstsc.exe to your antivirus/firewall exception list. Registry Tweak:
If the server is rejecting too many requests, you can increase the connection limit by running this in an admin Command Prompt:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v MaxOutstandingConnections /t REG_DWORD /d 65536 www.remoteaccesspcdesktop.com 4. Platform-Specific Workarounds Fixed: Remote Desktop 0x904 Error [2 Solutions] - AnyViewer
Error code 0x904 (often seen as 0x904 or 0x00000904) in Microsoft Remote Desktop (RDP) typically translates to:
"The connection was terminated because the server certificate could not be validated."
More precisely, it is a TLS/SSL certificate validation failure during the RDP handshake. The client receives a certificate from the RDP server (Windows, Azure Virtual Desktop, or third-party gateway), but the client rejects it.
Associated error message examples:
On Windows client, check Event Viewer:
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation" -Name "AllowEncryptionOracle" -Value 2 -Type DWord
Sometimes the service responsible for resolving names gets stuck.
If the IP address works but the hostname consistently fails, you can manually map the name to the IP.
Are you trying to connect to an office PC?
NLA can enforce strict security checks that fail due to licensing mismatches.
On the remote host:
Better because: Bypasses an unnecessary security handshake that sometimes exposes licensing bugs. Solutions to Resolve Error Code 0x904 Don't worry;

