A piece of my work around PowerShell and IIS (or usefull things I've found on the web). Mostly some reminders for myself!

Installs a .pfx file

 

Function Add-SSLCertificate{
param([string]$pfxPath,[string]$pfxPassword,[string]$HostHeader,[string]$Website)

Import-Module "WebAdministration" -ErrorAction Stop
$certMgr = New-Object -ComObject IIS.CertObj -ErrorAction SilentlyContinue
$certMgr.ImportToCertStore($PfxPath,$PfxPassword,$true,$true)

New-WebBinding -Name $Website -Port 443 -Protocol https -HostHeader $HostHeader
}

Name*Email*WebsiteComment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top