【问题标题】:PSSession Access Denied ErrorPSSession 访问被拒绝错误
【发布时间】: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。

标签: powershell remote-access


【解决方案1】:

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

还要检查当您键入以下winrm get winrm/config/service/authwinrm get winrm/config/client/auth 时是否为Certificate = true

如果没有启用它们,请键入 winrm set winrm/config/service/auth '@{Certificate="true"}'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-24
    • 2012-12-21
    • 2010-12-23
    • 2017-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多