Error Description
The error message "The WS-Management service cannot process the request because the specified URI is not supported on the service side. Retry the request with local session" typically occurs when you try to execute WinRM (Windows Remote Management) commands or establish a remote PowerShell session, but the local configuration restricts remote connections.
This happens because the local WinRM client is attempting to access a remote resource or address that is not configured or permitted in the WS-Management (WSMan) trusted hosts list, or because the WinRM service itself is misconfigured or disabled on the local machine. By enforcing a "local session," Windows prevents the execution of commands over network protocols until explicit permissions and configurations are established.
Step-by-Step Fix
Follow these straightforward steps to resolve the issue by enabling WinRM and configuring the trusted hosts list.
Step 1: Open PowerShell as Administrator
- Click on the Start Menu or press the
Windows Key. - Type PowerShell into the search bar.
- Right-click on Windows PowerShell from the search results.
- Select Run as administrator.
- Click Yes if a User Account Control (UAC) prompt appears.
Step 2: Enable and Configure the WinRM Service
You need to ensure that the Windows Remote Management service is running and properly configured on your system.
- In the PowerShell window, type the following command and press
Enter:winrm quickconfig - If the system prompts you to make changes (such as starting the service or enabling the firewall exception), type
y(for Yes) and pressEnterfor each prompt.
Step 3: Configure Trusted Hosts
If you are trying to connect to a specific remote machine, or if a local script requires loopback remote permissions, you must add the target to your trusted hosts list.
- To trust all hosts for testing or environment setup, type the following command and press
Enter:Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force(Note: If you only want to trust a specific computer, replace `
with the specific IP address or hostname of that computer, for example:Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.50" -Force`)*
Step 4: Restart the WinRM Service
Apply the configuration changes by restarting the service.
- Type the following command and press
Enter:Restart-Service WinRM
Step 5: Verify the Configuration
Ensure that the changes have been saved successfully.
- Type the following command to check your trusted hosts list and press
Enter:Get-Item WSMan:\localhost\Client\TrustedHosts - Verify that the output displays the value (
*or the specific IP/hostname) you set in Step 3.
Once these steps are completed, rerun your original command or script, and the error should be resolved.
ERROR_WINRS_CLIENT_GET_NULL_PARAM | ERROR_WSMAN_POLYMORPHISM_MODE_UNSUPPORTED | ERROR_WSMAN_URI_NON_DMTF_CLASS | ERROR_WSMAN_URI_WRONG_DMTF_VERSION | ERROR_WSMAN_PUSHSUBSCRIPTION_INVALIDUSERACCOUNTThere may be some errors. Learn Microsoft