Powershell – winrm using ip address instead of computer name

powershellwinrm

Is it possible to set up winrm using IP address instead of the computer name.

The computer in question is only

I have only been able to set winrm up for a computer in the same domain like this:

winrm s winrm/config/client '@{TrustedHosts="demox"}

The computer I want to connect to is not accessible by computer name.

Best Answer

You can add the IP address to the TrustedHost list:

winrm s winrm/config/client '@{TrustedHosts="10.1.2.1"}'

Using this I managed to connect to a Windows 2003 server in a different domain, which I could connect to using either, the NETBIOS or FQN name yesterday.