Cannot Make Remote Connection

by GuyThomas at 2013-01-01 11:29:01

I have four machines, two Windows 7, the other 2 Windows 8. None can make a remote connection. With each combination that I try, I get the same error ‘The client cannot connect to the destination’.

The machines are in homegroup, and can see each other on the network.
Remote Desktop Connection works fine, and I have disconnected at least two of the firewalls.
Enable-PSRemoting runs successfully.
I have set TrustedHosts to *.

winrm quickconfig
The command completed successfully.

PS C:\WINDOWS\system32> winrm quickconfig
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.

PS C:\WINDOWS\system32> winrm quickconfig
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.

PS C:\WINDOWS\system32>

Enter-PSSession –computerName win7

PS C:\WINDOWS\system32> Enter-PSSession –computerName win7
Enter-PSSession : Connecting to remote server win7 failed with the following error message : 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". For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession –computerName win7
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (win7:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
by DonJ at 2013-01-01 12:05:42
Remoting doesn’t like non-domain as much. You’ve taken one step in setting TrustedHosts. However, you must also always specify -Credential when making a connection.

Also, you should enable Remoting with Enable-PSRemoting, not "winrm quickconfig." The latter doesn’t do every necessary step. It doesn’t, for example, put exceptions into the Windows Firewall, nor does it register PowerShell as an endpoint or set up session configurations.
by GuyThomas at 2013-01-01 12:48:12
I appreciate the quick response, it motivates me to try other settings, such as -Credential

Sadly it’s still not working. I had previously run Enable-PSRemoting.

Note what you say about remoting being for domains.
by DonJ at 2013-01-01 13:00:32
Well, not so much ‘for domains,’ but Remoting is definitely easier in a domain. It’s because of the mutual authentication requirement. Have you gone through "Secrets of PowerShell Remoting?" (powershellbooks.com; it’s free) I cover most of the different setup scenarios in there. Might be worth going over just to see if you missed anything.
by GuyThomas at 2013-01-01 13:09:03
Good news: I tried a different combination of my 4 machines and got an ‘Access denied’ message; I thought of your -Credential suggestion, eureka, it worked when I appended and typed the password in the box!

Yes I read (skimmed) your Secrets of PowerShell Remoting. I could not find a reference to the error: ‘The client cannot connect to the destination…’
by DonJ at 2013-01-01 13:28:40
That particular error usually means basic connectivity is not working. I usually check the firewall, the WinRM service status, the PowerShell session configurations, all of the things that have to do with basic connectivity. It means you’re not even getting to the point of authenticating. I’ll often have to do a diagnostics trace and pore through the log entries. It can be time-consuming, but it’s how you have to troubleshoot that kind of problem. That procedure is covered in the book, too, as are suggestions for troubleshooting that kind of connectivity issue. I perhaps just didn’t include that exact error message, as it differs somewhat between versions.
by GuyThomas at 2013-01-02 12:04:38
Update: Thanks to your help with the -Credential parameter this is the position.

I have 4 machines A, J, T and W.
Machines A and J can Remote In and Out (perfect), Machine T can remote Out only. Machine W cannot remote in or Out.

Conclusion:
About a year ago I had remoting working on machine W, but something has gone wrong with that machine. I am happy that I can experiment with remoting once more. Thanks for your help and support, case closed.