WinRM connection refused

Andrea Caldarone 66 Reputation points
2020-10-07T18:14:21.88+00:00

Hi all,

I'm trying to use PowerShell remoting between 2 Windows Server 2016, when I try a simple

Test-WSMan -ComputerName SERVERNAME

I get this error:
Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859026"
Machine="SERVERNAME.mydomain.local"><f:Message>The connection to the specified remote host was refused. Verify that the
WS-Management service is running on the remote host and configured to listen for requests on the correct port and HTTP
URL. </f:Message></f:WSManFault>
At line:1 char:1

  • Test-WSMan -ComputerName SERVERNAME
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidOperation: (SERVERNAME:String) [Test-WSMan], InvalidOperationException
  • FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

I've verified that, on both servers:
WinRM service is running
PowerShell remoting is enabled (Enable-PSRemoting -Force)
Servers are in white list (Set-Item WSMan:localhost\client\trustedhosts -value * )
Firewall is disabled
I can telnet on port 5985
There is no proxy configured
There is no GPO configured for WinRM Service / CLient
List item

Windows Server Management
Windows Server Management
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Management: The act or process of organizing, handling, directing or controlling something.
424 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Dave Patrick 426.4K Reputation points MVP
    2020-10-07T18:31:51.113+00:00

    Might check the UAC filtering
    https://video2.skills-academy.com/en-us/windows/win32/winrm/obtaining-data-from-a-remote-computer

    --please don't forget to Accept as answer if the reply is helpful--

    1 person found this answer helpful.
    0 comments No comments

  2. Andrea Caldarone 66 Reputation points
    2020-10-08T06:22:36.92+00:00

    Hello @Dave Patrick ,

    the 2 windows server are joined to the same domain, the account I'm using is member of Administrators Group on both machines.

    1 person found this answer helpful.
    0 comments No comments

  3. Jenny Yan-MSFT 9,326 Reputation points
    2020-10-09T08:19:41.67+00:00

    Hi,
    1.For the target computer, is there any role installed? Cause below is a similar error message prompted for exchange server.
    https://video2.skills-academy.com/en-us/exchange/troubleshoot/administration/fail-to-start-exchange-management-shell-console

    2.Please test by another command for remote WinRM functionality
    winrm id –r:<remoteserver>
    https://social.technet.microsoft.com/wiki/contents/articles/9126.vmm-troubleshooting-windows-remote-management-winrm.aspx

    3.In target computer, have you retried the winrm QC to perform a Quick Configuration of WinRM and verify the command again?

    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny