I am trying to get two workgroup machines (both are Windows 2012 R2) to talk to each other using PowerShell via WinRM. Let's call them ServerA and ServerB. On both machines I ran the following commands:
Enable-PSRemoting -Force
Set-Item WsMan:\localhost\client\trustedhosts Server[A|B]
Restart-Service WinRM
From ServerB I can connect remotely to ServerA using the Enter-PSSession ServerA
command. However, I cannot connect in the other direction. ServerA cannot connect to ServerB. I get the following error message:
enter-pssession : Connecting to remote server ServerB 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. At line:1 char:1 + enter-pssession ServerB + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (ServerB:String) [Enter-PSSes sion], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
I also tried connecting a remote session to the server itself. I.E. from ServerB Enter-PSSession ServerB
. I get the same error as above. I tried disabling both firewalls completely and that did not help either. I also tried doing a Test-NetConnection ServerB -port 5985
and that gives me a warning saying:
WARNING: TCP connect to ServerB:5985 failed
ComputerName : ServerB
RemoteAddress : ip
RemotePort : 5985
InterfaceAlias : Ethernet
SourceAddress : ip
PingSucceeded : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False
By using the Test-NetConnection
command I do see an entry in the PowerShell Event Log that reads:
Error Message = Exception calling ".ctor" with "2" argument(s): "No connection could be made because the target machine actively refused it ip:5985" ...
What are some other steps I can take to troubleshoot this connection problem?