IIS 8.5 change bindings on bulk (due to SSL certificate renewal)

bindingsiis-8.5ssl-certificate

I just renewed a Comodo Wildcard SSL certificate and I created the PFX in order to install it on my Windows Server 2012 R2 which is a VM on Microsoft Azure.

I use IIS 8.5 for all my websites which includes about 300 subdomains of the main domain name. So, the main domain is eg. example.com and all subdomains are like customer1.example.com, customer2.example.com, etc.

After I will install the renewed certificate, I will have to change the IIS binding for all of these subdomains as well to point to the new certificate.

I cannot find a way to do this without changing every single binding manually.

Is there any way to change all these bindings on bulk?

Best Answer

https://blogs.technet.microsoft.com/heyscriptingguy/2015/03/01/weekend-scripter-use-powershell-to-update-ssl-bindings/

The important part from that article is this:

get-item -Path "cert:\LocalMachine\My\$certShop" |
    new-item -path IIS:\SslBindings\10.238.82.89!443

Where $certShop is the thumbprint of the new certificate.