Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enter-PSSession to remote server fails with "cannot find the computer"

Tags:

My desktop is win7 and I am trying to connect to a server 2012.
Both hosts are on the same domain.

If I do:

Enter-PSSession -ComputerName *ServerName***    

I get the following failure message from winrm

Enter-PSSession : Connecting to remote server xxx failed with the following error message : WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot find the computer xxx. Verify that the computer exists on the network and that the name provided is spelled correctly.*

It doesn't matter if I use just the server name or if I enter it fully qualified.

Both systems show $PSVersionTable.PSVersion 4 0 -1 -1

I have tried the various troubleshooting hints that I found i.e.
run Enable-PSRemoting -Force and also set TrustedHosts = * on both sides.
I also disabled the firewall service on both sides.
When I try to Enter-PSSession from the server to my desktop it works as desired.
But from my desktop to the server I always get the error message that the computer cannot be found.

like image 651
user333869 Avatar asked Jun 01 '15 08:06

user333869


People also ask

How do I start a PSSession on a remote computer?

To use the PSSession to interact directly with a remote computer, use the Enter-PSSession cmdlet. For more information, see about_PSSessions. You can run commands on a remote computer without creating a PSSession with the ComputerName parameters of Enter-PSSession or Invoke-Command .

What is PSSession used for?

Use a PSSession when you need a persistent connection to a remote computer. With a PSSession, you can run a series of commands that share data, such as the value of variables, the contents of a function, or the definition of an alias. You can run remote commands without creating a PSSession.

How do I enable PSRemoting?

PowerShell remoting is enabled by default on Windows Server platforms. You can use Enable-PSRemoting to enable PowerShell remoting on other supported versions of Windows and to re-enable remoting if it becomes disabled. You have to run this command only one time on each computer that will receive commands.


1 Answers

After talking to our domain admin I think I found the cause of the problem.
The server is in a resource domain which only has a one way trust to the main OU.
This explains why I can do PS remoting from the server to the clients but not vice versa.
I found that I can use the IP address with the -Credential option in my case though which isn't nice but an acceptable workaround.

like image 145
user333869 Avatar answered Sep 28 '22 08:09

user333869