Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell remoting error - network path not found

I cannot connect to remote server using enter-pssession -computername serverA. My scenario:

  • I have 2 Win 2003 R2 servers in the same domain. ServerA is WSUS server, serverB is a domain controller
  • Both servers have enabled powershell remoting
  • Both servers have configured winrm (winrm quickconfig)
  • Both servers have TrustedHosts set to *
  • setspn.exe is set up correctly (http, https, wsman etc.)
  • Both servers have FireWall turned off
  • Both servers have PowerShell 2.0

I am trying to enter-pssession -computername serverA under the domain admin credentials from serverB to serverA and it throws the following error:

"""Enter-PSSession : Connection to remote server failed with the following error message : WinRM cannot process the request. The following error occured while using Kerberos authentication: The network path was not found."""

When I try to enter-pssession -computername serverB under the domain admin credentials from serverA it works fine! It also works if I use localhost so: enter-pssession -computername localhost under the domain admin credentials (on serverA) works as well, but when I try the hostname on serverA (instead of localhost) enter-pssession -computername serverA it throws the same error.

I also tried to use get-credential and provide different types of credentials, but it did not help. The only thing which helped was using a local (not domain) administrator account and running enter-pssession -computername serverA -credentials $cred and it worked, but only locally, I was able to do this from local machine (from serverA to itself) but not from serverB to serverA under the serverA\administrator credentials.

Any ideas?

Thanks

like image 613
kubusz Avatar asked Jul 30 '12 11:07

kubusz


People also ask

What is PSRemoting in powershell?

By default, Enable-PSRemoting creates network rules that allow remote access from private and domain networks. The command uses the SkipNetworkProfileCheck parameter to allow remote access from public networks in the same local subnet. The command specifies the Force parameter to suppress confirmation messages.

What is the network path?

The project management term network path refers to any consecutive or continuous series of work or project schedule activities that may form some sort of a connection with a number of logical relationships as designated in the project schedule network diagram.


1 Answers

First of all I created credential variable with my domain admin account:

$cred = get-credential - I typed my domain\username and password

Then I used IP address instead of hostname in -ComputerName parameter, so the enter-pssession looks like:

Enter-Pssession -ComputerName 192.168.1.111 -Credential $cred

this approach works for the invoke-command as well

invoke-command -ComputerName 192.168.1.111 -Credential $cred -ScriptBlock {hostname}

I still do not know why it does not work with the hostname and why do I have to create $cred, but as I need a quick solution, this works fine for me.

Thanks for help.

like image 137
kubusz Avatar answered Oct 22 '22 02:10

kubusz