Enter-PSSession to remote server fails with “canno

2019-02-12 08:52发布

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.

6条回答
再贱就再见
2楼-- · 2019-02-12 09:14

Check Domain Replication and see if the computer object is where its supposed to be. This is something I had to deal with for computer objects that were not replicated from one domain controller to another.

There is a self-signed certificate under local computer / RDP ... make sure there is one there for WinRM service to use.

See if you can find out if there is any firewall that might be blocking the WinRM ports.

Hope it helps.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-12 09:16

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.

查看更多
老娘就宠你
4楼-- · 2019-02-12 09:23

I know its very late but i am putting my fix to the few sites that experienced the same issue. for me it was a duplicate computer name in the root domain. found it by running setspn -f -q */servername. this popped up the server name in multiple domains. deleting the invalid machine from the root AD and root dns, and i was up and running.

查看更多
beautiful°
5楼-- · 2019-02-12 09:24

In my case DNS was was pointing to the right IP yet there wase a typo in the hostname so basicaly the parameter -Computername and the actual hostname didn't match.

查看更多
孤傲高冷的网名
6楼-- · 2019-02-12 09:25

This is most likely caused by your netbios name being different from the server's hostname. Try to connect with the netbios name instead.

  • Determine the correct name by running the following command in powershell:

"$env:COMPUTERNAME.$env:USERDNSDOMAIN"

查看更多
地球回转人心会变
7楼-- · 2019-02-12 09:26

run winrm quickconfig from a powershell session on the remote machine

查看更多
登录 后发表回答