我的问题类似于Powershell远程:一种方法相信 ,但是有差异和解决scheme(将服务器添加到受信任的列表)不起作用。
场景:
我有两个域名 DOMAIN和DOMAINDMZ。 DOMAIN有来自DOMAINDMZ的传入信任。 这是DOMAINDMZ信任DOMAIN,但不是相反。
我有一个DOMAIN\myadminpipe理用户,他是DOMAINDMZ域中几个服务器上Administrators本地组的成员: servera.domaindmz.com , serverb.domaindmz.com , serverc.domaindmz.com等。我可以login到这些来自控制台或RDP的DOMAIN \ myadmin服务器。
我正在尝试login到SERVERA并使用PowerShell远程处理在SERVERB上运行PowerShell脚本。 远程pipe理在SERVERB上启用。 我在SERVERA上启动一个提升的PowerShell会话,然后尝试使用Invoke-Command cmdlet。 我收到以下错误:
PS C:\Windows\system32> Invoke-Command -ComputerName serverb.domaindmz.com -ScriptBlock {hostname} [serverb.domaindmz.com] Connecting 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. Possible causes are: -The user name or password specified are invalid. -Kerberos is used when no authentication method and no user name are specified. -Kerberos accepts domain user names, but not local user names. -The Service Principal Name (SPN) for the remote computer name and port does not exist. -The client and remote computers are in different domains and there is no trust between the two domains. After checking for the above issues, try the following: -Check the Event Viewer for events related to authentication. -Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport. Note that computers in the TrustedHosts list might not be authenticated. -For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken
如果我在DOMAINDMZ域中提供包含用户的凭证对象,则错误消失,并且脚本块按预期执行:
PS C:\Windows\system32> Invoke-Command -ComputerName serverb.domaindmz.com -Credential DOMAINDMZ\Administrator -ScriptBlock {hostname} SERVERB
题:
鉴于错误,我怀疑这个问题与信任和Kerberos有关,但我不清楚我能做些什么来解决。 我应该为DOMAIN \ myadmin或SERVERB设置SPN吗? 有什么我可以尝试吗?
正如Joeqwerty所说的那样,人们通常会接受你将要使用具有外部信任的NTLM身份validation,以及具有森林信任的Kerberos。
但是,可以使用外部域来获得Kerberos身份validation,但有条件。
信任必须使用完全限定的域名(FQDN)来创build。 如果可信域对象中缺lessFQDN,则Kerberos引用将失败。
用户名语法是UPN,UPN后缀可以parsing为DNS中的DC(隐式UPN)
用户域中的域控制器将打开UDP 389,UDP / TCP 88和UDP / TCP 464端口。
信任资源域中的服务器名称必须是FQDN,并且服务器名称的域后缀必须与AD DS域的DNS FQDN相匹配。
如果在此之后它仍然导致你太多的胃灼热,我build议切换到通过SSL保护的协商身份validation。
一些额外的阅读/参考:
http://technet.microsoft.com/en-us/library/dd560679(WS.10).aspx