Connecting to remote server failed using WinRM from PowerShell

If the client and the remote machine aren’t on the same domain, you have one of two options:

  • use HTTPS as a transport protocol
  • add the remote machine to the list of trusted hosts on the client

In order to configure WinRM to use HTTPS, open up a PowerShell console as administrator on both machines and run:

winrm quickconfig -transport:https

and open port 5986 on the firewall:

netsh firewall add portopening TCP 5986 "WinRM over HTTPS"

Alternatively, you can add the remote machine as trusted host on the client by running:

winrm set winrm/config/client @{TrustedHosts="10.0.5.35"}

Leave a Comment