I have two servers (sourceserver1 and destinationserver1). They are not on the same network segment, but do have connectivity. Today, Invoke-Command stopped working when sourceserver1 tries to connect to destinationserver1 and I am not sure why. PowerShell shows the error:
[<destinationserver1's IPv4>] Connecting to remote server <destinationserver1's IPv4> failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.
On destinationserver1, I checked:
Ran: winrm quickconfig
Result: WinRM already configured
Ran: Get-WSManInstance winrm/config/listener -Enumerate
Result:
cfg :
xsi :
lang : en-US
Address : *
Transport : HTTP
Port : 5985
Hostname :
Enabled : true
URLPrefix : wsman
CertificateThumbprint :
ListeningOn : {127.0.0.1, <destinationserver1's IPv4>, ::1, <destinationserver1's IPv6>}
Ran: winrm get winrm/config
Result: No IPv4 or IPv6 filters
Ran: netstat -aon | find "5985"
Result:
TCP 0.0.0.0:5985 0.0.0.0:0 LISTENING 4
TCP <destinationserver1's IPv4>:5985 <sourceserver1's IPv4>:57526 ESTABLISHED 4
TCP <destinationserver1's IPv4>:5985 <sourceserver1's IPv4>:57544 ESTABLISHED 4
TCP <destinationserver1's IPv4>:5985 <sourceserver1's IPv4>:57585 ESTABLISHED 4
TCP [::]:5985 [::]:0 LISTENING 4
On sourceserver1, I checked:
Ran: (get-Item wsman:\localhost\client\trustedhosts).value
Result: found the IP of destinationserver1, which is how I am trying to connect
Ran: telnet <destinationserver1's IPv4> 5985
Result: the connection was successful
Ran: Test-NetConnection <destinationserver1's IPv4> -port 5985
Result:
ComputerName : <destinationserver1's IPv4>
RemoteAddress : <destinationserver1's IPv4>
RemotePort : 5985
InterfaceAlias : Ethernet
SourceAddress : <sourceserver1's IPv4>
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : True
Other connectivity, like "ping" works, in both directions.
Not sure what else to check.
Reset to default