I'm trying to remote on to another computer (an aws workspace) and using:
Enter-PSSession -ComputerName [IP-ADDRESS] -Credential $cred
But get error:
Enter-PSSession : Connecting to remote server [IP-ADDRESS] 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.
At line:1 char:1
+ Enter-PSSession -ComputerName [IP-ADDRESS] -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: ([IP-ADDRESS]:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
And the Ip address i am using in place of [IP-ADDRESS] is correct.
I have done winrm quickconfig
on both the local and remote machine and confirmed that WinRM service is already running and set up on the computer.
I have done Set-Item WSMan:\localhost\Client\TrustedHosts *
so that everything is trusted.
I have tried editing the Inbound rules for Windows Remote Management HTTP-In to allow any IP address but still get the same error.
I can start a remote session using the Remote Desktop Connection application so it is just an issue trying to start an issue through Powershell
Is there any other setting I need to configure?
If You Just use "winrm quickconfig".. Then be sure that Your netconnectionprofile is set to Private. To see the profile use "Get-NetConnectionProfile" If this is "Public" the connection can't be established and You get the error message. Option is to use "Enable-PSRemoting -SkipNetworkProfileCheck" then it should work.