windows WinRM客户端收到HTTP服务器错误状态(500)

ycl3bljg  于 2023-10-22  发布在  Windows
关注(0)|答案(1)|浏览(205)

我正在尝试从一个Windows VM运行Powershell脚本并访问另一个Windows VM。但我得到了以下错误。我已经验证了几乎所有的论坛,并作出必要的配置,但没有运气。有人知道如何解决这个错误吗?

##[error][ABC.domain.com] Connecting to remote server 
ABC.domain.com failed with the following error message : The WinRM 
client received an HTTP server error status (500), but the remote service did 
not include any other information about the cause of the failure. For more 
information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (ABC.domain.com:String) [ 
   ], PSRemotingTransportException
    + FullyQualifiedErrorId : WinRMHttpError,PSSessionStateBroken
wlzqhblo

wlzqhblo1#

这是因为WinRm服务配置与我们配置的https侦听器具有不同的证书指纹。
下面两行的指纹不匹配

get-childitem wsman:\localhost\listener | ?{ $_.keys -like '*transport=https*' } | get-childitem
get-Item WSMan:\localhost\Service\CertificateThumbprint

将服务配置指纹设置为空字符串为我们修复了它:

Set-Item WSMan:\localhost\Service\CertificateThumbprint -Value ''

作为参考,关于原始错误,除了客户端的500错误之外,服务器的系统事件日志中的错误如下:

The WinRM service failed to initialize CredSSP. 

 Additional Data 
 The error received was 0x80338082.

 User Action 
 Configure CertificateThumbprint setting under the WinRM configuration for the service. Use the thumbprint of a valid certificate and make sure that Network Service has access to the private key of the certificate.

相关问题