Is it possible to remote into a external server outside my domain? (By remote I mean start a PSSession). I am attempting the following:
Enter-PSSession -ConnectionUri http://<remote_ip>:5985 -Credential <username>
I then get a popup window asking me to enter the password. After I do, I get the following:
-----------------------
Enter-PSSession : Connecting to remote server 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:16
+ Enter-PSSession <<<< -ConnectionUri http://<remote_ip>:5895 -Credential <username>
+ CategoryInfo : InvalidArgument: (http://<remote_ip>:5895/:Uri) [Enter-PSSession], PSRemotingTranspor
tException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
------------------------------
I have tried the following:
I first attempted on my local machine to check if the remote machine was actually listening the port:
telnet <remote_ip> 5985
And the Port seems to be open. I also have temporarily disabled the firewalls on both machines in the above attempts.
At the remote machine I attempted:
Enter-PSSession -ConnectionUri http://<remote_ip>:5985 -Credential <username>
This worked and I verified that the password I was using was correct.(This is my attempt to start a PSSession from the Remote machine to itself. Since this worked I am convinced that my credentials are correct and PowerShell Remoting has been enabled on the Remote Machine.)
By the way, I have also tried to use the username normally and also along with the remote domain name in the form:
<domain>\<username>
Finally TrustedHosts is a * on both machines.
I would appreciate any help or ideas. Thank you to all.