Powershell remoting with ip-address as target Powershell remoting with ip-address as target powershell powershell

Powershell remoting with ip-address as target


The error message is giving you most of what you need. This isn't just about the TrustedHosts list; it's saying that in order to use an IP address with the default authentication scheme, you have to ALSO be using HTTPS (which isn't configured by default) and provide explicit credentials. I can tell you're at least not using SSL, because you didn't use the -UseSSL switch.

Note that SSL/HTTPS is not configured by default - that's an extra step you'll have to take. You can't just add -UseSSL.

The default authentication mechanism is Kerberos, and it wants to see real host names as they appear in AD. Not IP addresses, not DNS CNAME nicknames. Some folks will enable Basic authentication, which is less picky - but you should also set up HTTPS since you'd otherwise pass credentials in cleartext. Enable-PSRemoting only sets up HTTP.

Adding names to your hosts file won't work. This isn't an issue of name resolution; it's about how the mutual authentication between computers is carried out.

Additionally, if the two computers involved in this connection aren't in the same AD domain, the default authentication mechanism won't work. Read "help about_remote_troubleshooting" for information on configuring non-domain and cross-domain authentication.

From the docs at http://technet.microsoft.com/en-us/library/dd347642.aspx

HOW TO USE AN IP ADDRESS IN A REMOTE COMMAND-----------------------------------------------------    ERROR:  The WinRM client cannot process the request. If the    authentication scheme is different from Kerberos, or if the client    computer is not joined to a domain, then HTTPS transport must be used    or the destination machine must be added to the TrustedHosts    configuration setting.The ComputerName parameters of the New-PSSession, Enter-PSSession andInvoke-Command cmdlets accept an IP address as a valid value. However,because Kerberos authentication does not support IP addresses, NTLMauthentication is used by default whenever you specify an IP address. When using NTLM authentication, the following procedure is requiredfor remoting.1. Configure the computer for HTTPS transport or add the IP addresses   of the remote computers to the TrustedHosts list on the local   computer.   For instructions, see "How to Add a Computer to the TrustedHosts   List" below.2. Use the Credential parameter in all remote commands.   This is required even when you are submitting the credentials   of the current user.


Try doing this:

Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force


I test your assertion in my infrastructure the IP address is not the problem the following works for me :

PS C:\Users\JPB> hostnameJPBCOMPUTERPS C:\Users\JPB> Enter-PSSession -ComputerName 192.168.183.100 -Credential $cred[192.168.183.100]: PS C:\Users\jpb\Documents>[192.168.183.100]: PS C:\Users\jpb\Documents> hostnameWM2008R2ENT

If you try to work accross a VPN you'd better have to have a look to the firewall settings on the way to your server. Installation and Configuration for Windows Remote Management can help you. The TCP port WinRM is waiting on are :

WinRM 1.1 and earlier: The default HTTP port is 80.

WinRM 2.0: The default HTTP port is 5985.


Edited : According to your error can you test this on youclient computer :

Set-Item WSMan:\localhost\Client\TrustedHosts *