【发布时间】:2016-05-27 08:36:19
【问题描述】:
我尝试使用 PSSession 和证书作为身份验证从机器 psttest01 连接到机器 psttest02。为此我使用了这个命令:
Enter-PSSession -ComputerName psttest02 -CertificateThumbprint 7221fc5479300189759ed18031c9c0
但我收到拒绝访问错误。
当我使用这样的凭据时:
Enter-PSSession -ComputerName psttest02 -Credential (Get-Credential)
它工作正常。我做错了什么?如果您需要更多信息,请告诉我
【问题讨论】:
-
计算机 psttest02 是否设置为使用证书身份验证?例如。您是否已将 WinRM 设置为侦听该证书?
-
是的,我做了一个
Enable-PSRemoting。我还配置了一个HTTPS监听器,并将psttest01的客户端证书映射到psttest02上。我在两台机器上都做了一个Set-Item wsman:\localhost\client\trustedhosts *。 -
证书是否存在于两台机器上,在受信任的根目录中?您是否在没有激活软件防火墙的情况下尝试过?除了
Access denied,你还得到其他信息吗? -
我完全关闭了防火墙。两个证书都在两台机器上的受信任根中。是的,还有更多,但它是德语的,没什么重要的。但是在错误的末尾还有其他内容:
+Enter-PSSession -ComputerName psttest02 -CertificateThumbprint 7221fc54793001897... +******************************************************************************* +CategoryInfo : InvalidArgument: (psttest02:String) [Enter-PSSession], PSRemotingTransportException +FullyQualifiedErrorId: CreateRemoteRunspaceFailed -
您还需要
-UseSSL参数才能使其工作。因为Enter-PSSession默认使用HTTP。