derekbaker783
derekbaker783

Reputation: 9591

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

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

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.

Upvotes: 2

Views: 6016

Answers (1)

derekbaker783
derekbaker783

Reputation: 9591

If you've already installed the new cert, you can use the script below to configure WinRM to use the new cert.

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

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

Upvotes: 2

Related Questions