How to assign an different SSL certificate for the IIS7+ Management Service on Server-Core?
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`}
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]}
Check more discussion of this question.
No related posts.
Leave a comment
Recent Posts
- SCP transfer only modified files
- How can I automate clearing and resetting a Linux user’s home directory to a default?
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





