0
votes

I am getting below error message when I try to access one of the AWS Cloud Servers through"Enter-PSSession" cmdlet. I have Admin rights on the server and provide the necessary credential as well but still no gain. Please help to resolve or suggest alternate way to remotely access the Server.

------------------Connecting to remote server XYZ.XXXXXX.com failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.

2
Did you run Get-Help about_Remote_Troubleshooting? It is PowerShell's built-in documentation for configuring, troubleshooting, and using PowerShell remoting. It is also located online here.Shawn Esterman
I did that, but there is something blocking the connection which I am trying to establish, I am unable to figure out that.Gaurav Kumar
You did not provide enough information to troubleshoot though. You will probably have to check logs on the server, possibly enable verbose logging, and see why the server declined the connection. You might was to also review the article called "Installation and Configuration for Windows Remote Management"Shawn Esterman

2 Answers

0
votes

Make sure that the server behind that name has the proper IP address. You can do that if you ping the host name, and then ping the turned IP with attribute -a

    Ping server.com
    Ping -a <IP returned by that hostname>

If the second ping return different hostname, thats were you have problem. If it does not return any hostname, then it might be behind switch or firewall rule that does not allow reverse lookup.

If everything is good, try to see if the WinRM is working with the following command

    Test-WSMan <hostname or an IP>

If that is return the ProductVersion then that machine has WindowsRemote Manager enabled. If that is not working then you dont have windows remote management enabled on that machine, and of course check the firewall. But if you dont have an issue here then you better check if you have CredSSP enabled/disabled, but for that you would need to read a bit more, here is a nice article about it : https://4sysops.com/archives/using-credssp-for-second-hop-powershell-remoting/

And if after all that you still have the issue, make sure you know if you are using Certificates to authenticate, if thats the case it really depend on how your PKI is all set.

0
votes
  1. Make sure the remote host is reachable over you network .

  2. if reachable over network, make make sure remoting is enabled on the derstination server.

  3. if windows firewall service is not running, start it on the destination server .