Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When installing the Management service for IIS7+ a self-signed SSL certificate is created and assigned, it has the name 'WMSvc-ComputerName'.

In the GUI version I can change this to a different 'proper' certificate installed on the server, so it is trusted by remote clients.

The GUI module for the Management Service is not available when connecting to the server remotely.

So I need to change it using the command line on the server itself. How do I do this?

Solution in PowerShell:, (thanks to Mathias R. Jessen)

# get the thumbprint for the certificate we want to use:
$thumb = (Get-ChildItem cert:\LocalMachine\MY | where-object { $_.FriendlyName -eq   "www.stackoverflow.com" } | Select-Object -First 1).Thumbprint
# get a new guid:
$guid = [guid]::NewGuid()

# remove the self-signed certificate:
& netsh http delete sslcert ipport=0.0.0.0:8172
# add the 'proper' certificate:
& netsh http add sslcert ipport=0.0.0.0:8172 certhash=$thumb appid=`{$guid`}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Import the certificate using certutil:

certutil -importpfx [Path to certificate file]

Add the HTTPS binding to the site with appcmd:

appcmd set site "Default Web Site" /+bindings.[protocol='https',bindingInformation='*:443:']

Add the SSL Certificate to the endpoint with netsh:

netsh http add sslcert ipport=0.0.0.0:443 certhash=[thumbprint of certificate] appid={[random GUID]}
share|improve this answer
    
I know how to assign a certificate to a web site, I usually use Powershell for this, but the Management Service is NOT an IIS web site, it has its own Windows Service. I will look into the 'netsh add sslcert' command, maybe I can use that anyways. –  Peter Hahndorf May 2 '12 at 12:41
    
Just use the WMSvc endpoint instead (0.0.0.0:8172) –  Mathias R. Jessen May 2 '12 at 20:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.