Created
February 23, 2016 21:29
-
-
Save rheid/35e6f1af14248b82755b to your computer and use it in GitHub Desktop.
Add the matching IIS certificate to website and active SNI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Path = "cert:\localmachine\my" | |
$Certs = Get-ChildItem -path $Path | |
foreach ($cert in $Certs) | |
{ | |
#Get Folder-Informationen form Filessystem | |
$loop = $loop + 1; | |
foreach ($name in $cert.DnsNameList) | |
{ | |
Write-Host $name -ForegroundColor Green | |
New-WebBinding -Name $name -IP "*" -Port 443 -Protocol https -HostHeader $name -SslFlags 1 | |
$iisPath = "IIS:\SslBindings\!443!" + $name | |
New-Item -Path $iisPath -Value $cert -SSLFlags 1 | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment