How to fix "The WS-Management service cannot process the request."
Description of the Error
The error message "The WS-Management service cannot process the request" typically occurs when Windows Remote Management (WinRM) or Windows PowerShell Remoting fails to establish a connection between a local and a remote computer, or when local services cannot communicate with the WinRM infrastructure.
This issue generally stems from one of the following root causes:
- Service Disruption: The WinRM service is stopped, disabled, or corrupted.
- Configuration Mismatch: The WinRM listeners are not configured correctly, or they are not listening on the standard ports (HTTP port 5985 or HTTPS port 5986).
- Network and Security Policies: Windows Defender Firewall, third-party firewalls, or strict Group Policy Objects (GPO) are blocking the WS-Management traffic.
- Authentication and Trust Issues: The remote computer is not recognized as a trusted host by the client machine, or the user account lacks local administrator privileges on the destination computer.
- Resource Limits: The WS-Management maximum memory allocation per shell or maximum concurrent operations limit has been exceeded.
Step-by-Step Fixes for Windows
Follow these steps sequentially to resolve the error. Run these commands on both the local and remote machines if you are attempting a remote connection.
Step 1: Start and Configure the WinRM Service
The Windows Remote Management service must be running and set to start automatically.
- Press the Windows Key + R to open the Run dialog box.
- Type
services.mscand press Enter. - Scroll down to find Windows Remote Management (WS-Management).
- Right-click the service and select Properties.
- Change the Startup type to Automatic (Delayed Start) or Automatic.
- If the Service status is stopped, click the Start button.
- Click Apply and then OK.
Step 2: Run the Quick Config via PowerShell
Windows provides a built-in utility to automatically configure WinRM listeners, firewall exceptions, and default settings.
- Right-click the Start menu icon and select Windows Terminal (Admin) or PowerShell (Admin).
- Type the following command and press Enter:
winrm quickconfig - If prompted to make changes (such as enabling the service or creating a listener), type
y(Yes) and press Enter for each prompt.
Step 3: Add Target Computers to the TrustedHosts List
If you are connecting to a remote machine that is not part of an Active Directory Domain (or if you are working in a workgroup environment), you must explicitly trust the destination computer.
- Open PowerShell (Admin).
- To trust a specific computer, run the following command (replace
REMOTE COMPUTER NAME OR IPwith the actual name or IP address of the target machine):Set-Item WSMan:\localhost\Client\TrustedHosts -Value "REMOTE COMPUTER NAME OR IP"Note: If you want to allow connections to any computer for testing purposes, you can use a wildcard character (``), though this is less secure:*
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" - Type
yand press Enter to confirm the change. - Verify the configuration by running:
Get-Item WSMan:\localhost\Client\TrustedHosts
Step 4: Verify Firewall Exceptions
Windows Defender Firewall must allow traffic through the WinRM ports.
- Open PowerShell (Admin).
- Run the following command to enable the pre-configured Windows Remote Management firewall rules:
Enable-NetFirewallRule -DisplayGroup "Windows Remote Management" - If you are using a third-party firewall tool or an external network hardware firewall, ensure that inbound and outbound traffic is explicitly permitted on port 5985 (for HTTP) and port 5986 (for HTTPS).
Step 5: Restart the WinRM Service
Apply all changes cleanly by restarting the service architecture.
- Keep the PowerShell (Admin) window open.
- Execute the following command to restart the service:
Restart-Service winrm
Step 6: Test the Connection
Verify that the service architecture can process requests locally or remotely.
- To test the local WinRM functionality, run:
Test-WSManIf successful, this will output information detailing the OS version and the WS-Management product version.
- To test a connection to a remote machine, run:
Test-WSMan -ComputerName "REMOTE COMPUTER NAME OR IP"
ERROR_WSMAN_NON_PULL_SUBSCRIPTION_NOT_SUPPORTED | ERROR_WSMAN_WMI_MAX_NESTED | ERROR_WSMAN_WMI_PROVIDER_NOT_CAPABLE | ERROR_WSMAN_WMI_INVALID_VALUE | ERROR_WSMAN_WMI_SVC_ACCESS_DENIED
There may be some errors. Learn Microsoft