Sometimes when using a wildcard SSL or Unified Communications Certificate (UCC) it is necessary to add multiple https host headers for a single IP. Unfortunately the IIS 7 GUI does not allow you to set a host header on a https binding however this can be achieved using the “appcmd” command.

1. First bind the certificate to one site as normal by adding the https binding through the IIS GUI.

2. Open a command prompt and navigate to C:\Windows\System32\Inetsrv\ using the command below:

cd C:\Windows\System32\Inetsrv\

3. Enter the following command to manually set the binding bearing in mind the notes below:

appcmd set site /"SiteNameInIIS" /+bindings.[protocol='https',bindingInformation='']

Make sure to change the following values on the command above accordingly:

SiteNameInIIS: The site name exactly how it appears in IIS. For instance “”. The IP used by the site. The desired hostname. Note in most cases there will be one for www and non-www.

Example command:

appcmd set site /"" /+bindings.[protocol='https',bindingInformation='']

Running the appcmd command from a batch file:

To make this process easier you can use the batch file below. This will prompt you for the site name, IP, and host header value and then make the appropriate host header change.

Save the code as something like “addsslbinding.bat” and then call it from a command prompt by entering the name of the file (ie. “addsslbinding”).

@echo off
echo Enter site name in IIS:
set /p SiteName=
echo Enter IP address:
set /p IP=
echo Enter host header value (ie.
set /p HostHeader=
C:\Windows\System32\Inetsrv\appcmd set site /"%SiteName%" /+bindings.[protocol='https',bindingInformation='%IP%:443:%HostHeader%']


3 Responses to “Multiple HTTPS Bindings IIS 7 Using appcmd”

  • Gil says:

    AWESOME find man!
    Made my life much easier.
    You might as well mention that you can this easily remove bindings from IIS by switching from “+” to “-“.

  • Panos says:

    No matter what IIS7 deployment I try this one, afterwards my sites will not start giving the error “value does not fall within the expected range” Any thoughts as to why that might appear?

  • Jan says:

    Thank you so much . Saved a lot of time, moving from iis6.
    For testing on localhost using a batch file , Run as Administrator.

Leave a Reply