Windows Error Fix: WinRM Client URL Not Available
This guide provides a comprehensive description and step-by-step resolution for the Windows Remote Management (WinRM) connectivity error.
Error Description
The error message "The WinRM client sent a request to an HTTP server and got a response saying the requested HTTP URL was not available" typically indicates a misconfiguration between the WinRM client and the target listener service.
When you execute a remote command, the WinRM client attempts to connect to a specific URL endpoint (usually http://<ComputerName>:5985/wsman) on the target machine. This error occurs because the target HTTP server (the WinRM listener) actively received the request but rejected it. The primary causes include:
- The WinRM listener is not running or is not configured to listen on the correct port (default is 5985 for HTTP and 5986 for HTTPS).
- The Windows Remote Management service is stopped or disabled on the remote computer.
- The connection URL or port specified in your command does not match the listener configuration.
- A local or network firewall is blocking the traffic, or port sharing conflicts exist with another application using the same port.
- The Web Services-Management (WS-Management) SPN (Service Principal Name) is missing or improperly configured in Active Directory.
Step-by-Step Fixes
Follow these solutions sequentially on the target machine (the computer you are trying to connect to) or the source client machine as specified.
Solution 1: Enable and Restart the WinRM Service
The WinRM service must be running and set to start automatically on the target computer.
- Press the Windows Key + R on your keyboard to open the Run dialog box.
- Type
services.mscand press Enter. - Scroll down the list to find Windows Remote Management (WS-Management).
- Right-click on the service and select Properties.
- Change the Startup type dropdown menu to Automatic.
- Check the Service status. If it is stopped, click the Start button. If it is already running, click Stop and then click Start to restart it.
- Click Apply and then click OK to save the changes.
Solution 2: Quick-Configure WinRM via Command Prompt
This automated command fixes listeners, enables firewall exceptions, and configures default settings.
- Press the Windows Key, type
cmd, right-click on Command Prompt, and select Run as administrator. - Type the following command and press Enter:
winrm quickconfig - The system will analyze your configuration. If it prompts you to make changes (like creating a listener or enabling firewall exceptions), type
y(Yes) and press Enter for each prompt.
Solution 3: Verify and Recreate the WinRM Listeners
If the listener is corrupted or listening on the wrong URL path, you must recreate it.
- Open Command Prompt as an administrator.
- Check existing listeners by typing the following command and pressing Enter:
winrm enumerate winrm/config/listener - If no listeners appear, or if they look incorrect, delete the existing HTTP listener by running:
winrm delete winrm/config/Listener?Address=*+Transport=HTTP - Recreate the default HTTP listener using this command:
winrm create winrm/config/Listener?Address=*+Transport=HTTP - Verify the new listener configuration by running the enumeration command from step 2 again.
Solution 4: Configure Local Firewall Exceptions
Ensure that Windows Firewall is not dropping inbound traffic on the designated WinRM ports.
- Open Command Prompt as an administrator.
- Run the following command to allow inbound WinRM HTTP traffic through the firewall:
netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes - Alternatively, you can explicitly open port 5985 by executing:
netsh advfirewall firewall add rule name="WinRM HTTP Port 5985" dir=in action=allow protocol=TCP localport=5985
Solution 5: Adjust the LocalAccountTokenFilterPolicy (For Workgroups)
If you are connecting between computers that are not part of an Active Directory domain, Windows User Account Control (UAC) may restrict administrative privileges over remote connections.
- Press the Windows Key + R, type
regedit, and press Enter to open the Registry Editor. - Navigate to the following path in the left sidebar:
HKEY LOCAL MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System - Right-click on an empty space in the right pane, hover over New, and select DWORD (32-bit) Value.
- Name the new value exactly:
LocalAccountTokenFilterPolicy - Double-click the newly created
LocalAccountTokenFilterPolicyvalue, change the Value data to1, and keep the Base as Hexadecimal. - Click OK and close the Registry Editor.
- Restart your computer to apply the registry changes.
ERROR_WSMAN_HTTP_REQUEST_TOO_LARGE_STATUS | ERROR_WSMAN_HTTP_SERVICE_UNAVAILABLE_STATUS | ERROR_WSMAN_EVENTING_MISSING_LOCALE_IN_DELIVERY | ERROR_WSMAN_QUICK_CONFIG_FIREWALL_EXCEPTIONS_DISALLOWED | ERROR_WSMAN_QUICK_CONFIG_LOCAL_POLICY_CHANGE_DISALLOWED
There may be some errors. Learn Microsoft