PSSession 访问被拒绝错误

PSSession Access Denied Error

我尝试使用 PSSession 和证书作为身份验证从机器 psttest01 连接到机器 psttest02。为此,我使用了这个命令:

Enter-PSSession -ComputerName psttest02 -CertificateThumbprint 7221fc5479300189759ed18031c9c0

但是我收到拒绝访问错误。

当我像这样使用凭证时:

Enter-PSSession -ComputerName psttest02 -Credential (Get-Credential)

它工作正常。我做错了什么?如果您需要更多信息,请告诉我

确保您使用 -UseSSL 参数并检查证书是否存在于两台计算机的受信任的根目录中。

同时检查当您键入以下内容时 winrm get winrm/config/service/authwinrm get winrm/config/client/authCertificate = true

如果不通过键入 winrm set winrm/config/service/auth '@{Certificate="true"}'

启用它们