简体   繁体   English

如何使用Powershell更新WinRM使用的HTTPS证书?

[英]How to use Powershell to update the HTTPS cert used by WinRM?

How to use Powershell to update the HTTPS cert used by WinRM?如何使用Powershell更新WinRM使用的HTTPS证书?

I've reviewed the docs here , and they outline how to configure the WinRM cert via the GUI, but they don't illustrate how this would be done in Powershell .我在这里查看了文档,它们概述了如何通过 GUI 配置 WinRM 证书,但没有说明如何在Powershell中完成此操作。

If you've already installed the new cert, you can use the script below to configure WinRM to use the new cert.如果您已经安装了新证书,您可以使用下面的脚本来配置 WinRM 以使用新证书。

param(
    [Parameter(Mandatory=$true)]
    $certThumb
)

Set-WSManInstance -ResourceURI winrm/config/Listener -SelectorSet @{Address="*"; Transport="HTTPS"} -ValueSet @{CertificateThumbprint=$certThumb}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM