1
votes

I have a problem on one of my machine when I try to use it as WinRM client to connect into another machine. The scenario is:

  • The problem machine (VM A) on Window 7, has WinRM enable already (already ran winrm quickconfig, Enable-PSRemoting), then I add IP of the remote machine (VM C) into Trusted host of VM A then run Test-WSMan and I get this error Test-WSMan :

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".

The error in Windows Event Log

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  - <System>
      <Provider Name="Microsoft-Windows-WinRM" Guid="{A7975C8F-AC13-49F1-87DA-5A984A4AB417}" /> 
      <EventID>142</EventID> 
      <Version>0</Version> 
      <Level>2</Level> 
      <Task>10</Task> 
      <Opcode>2</Opcode> 
      <Keywords>0x4000000000000002</Keywords> 
      <TimeCreated SystemTime="2016-11-10T19:33:07.625538700Z" /> 
      <EventRecordID>29783</EventRecordID> 
      <Correlation ActivityID="{0350CC40-F800-0000-FB6D-459B2E3BD201}" /> 
      <Execution ProcessID="6284" ThreadID="7548" /> 
      <Channel>Microsoft-Windows-WinRM/Operational</Channel> 
      <Computer>[VM A Name]</Computer> 
      <Security UserID="S-1-5-21-1317227024-500078832-2798313031-10175" /> 
    </System>
  <EventData>
    <Data Name="operationName">Identify</Data> 
    <Data Name="errorCode">2150858770</Data> 
  </EventData>
</Event>
  • Test the winrm config and Enable-PSRemoting on VM C (VM C is Windows 2012R2)

  • I try these steps with other machine (VM B) to connect to VM C, enable WinRM by winrm quickconfig then run Test-WSMan, then it passes. So the problem is not on VM C.

  • I try to run Test-WSMan localhost on VM A, WinRM is working on this machine. Try to open port 5985 and 5986 for WinRM HTTP and HTTPS (netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow). I also try to Test-NetConnection on port 5985 from a Windows 2012 to VM A. Disable all Firewall rules on VM A.

I have no idea on what is the problem on VM A.

1

1 Answers

0
votes

Are all the machines in the same domain?

Make sure Both machines have each other as trusted hosts.

For example, i had to set TrustedHosts = "*" on my server to be able to send scripts to all my clients from that server.

My clients had to have my server as trusted host as well of course.

I was a bit confused over the fact that the sender/server had to trust the reciever/client.