我尝试从计算机 psttest01 连接到计算机 psttest02,并使用 PSSession 和证书作为身份验证。为此,我使用了以下命令:
Enter-PSSession -ComputerName psttest02 -CertificateThumbprint 7221fc5479300189759ed18031c9c0
但是我收到拒绝访问错误。
当我像这样使用凭据时:
Enter-PSSession -ComputerName psttest02 -Credential (Get-Credential)
它工作正常。我做错了什么?如果您需要更多信息,请告诉我
确保使用-UseSSL
参数并检查证书是否存在于受信任根中的两台计算机上。
还要检查键入以下winrm get winrm/config/service/auth
时是否winrm get winrm/config/client/auth
Certificate = true
如果没有,请通过键入winrm set winrm/config/service/auth '@{Certificate="true"}'
启用它们