HOWTO: Insert Multiple Website Bindings

Hmm... I am somewhat confused by proclamations of asking for advice when things are supposedly working correctly. I guess I will try and answer the question...

Question

David,

I have tried using your script and things are working correctly. Please advise.

I run the following which I think would now allow me to have 2 host headers for my SSL site

iisscript.vbs <SecureBindings> ":443:Site1.DNSName.com" ":443:Site1.DNSName.com",":443:Site2.DNSName.com"

Instead of getting 2 list entries when I run:

cscript.exe adsutil.vbs get <SecureBindings>.

I only get one entry and netither host header works: ":443:Site1.DNSName.com",":443:Site2.DNSName.com"

Do I have my syntax wrong?

Thanks,

Answer:

I love rhetorical questions. Yes, the syntax has to be wrong, because if it was right, we wouldn't be having this discussion. :-)

Before going any further, I need to note that the referenced tool is located here.

The way my tool works to edit a LIST data type is by:

  1. Identify the IIS Property of LIST data type to manipulate
  2. Give a string to match against the specific LIST item that you want to select for manipulation
  3. Give a string that will either replace or insert before the matched item from #2. This depends on whether /INSERT is given or not

This is better than ADSUTIL.VBS, which can only stomp over the entire LIST data value and NOT manipulate any one item in the LIST.

Given this information, let's see what you are doing. You gave:

iisscript.vbs <SecureBindings> ":443:Site1.DNSName.com" ":443:Site1.DNSName.com",":443:Site2.DNSName.com"

Which means to locate the SecureBindings property, find a LIST item containing ":443:Site1.DNSName.com" and replace its value with ":443:Site1.DNSName.com",":443:Site2.DNSName.com"

As you have stated yourself, all you wanted to do is to make the SecureBindings property have one additional LIST item (this is what it means to add a SecureBinding). Instead, what you did was change one LIST item to a new value containing a comma.

Hmm, I am not a rocket scientist, so can you point me to any documentation that says that comma-delimited configuration values are interpreted or manipulated as multiple LIST items by IIS or any tool? Ah-hah, I didn't think so... ;-)

Now, here are two ways add multiple LIST items at your disposal:

  1. ADSUTIL.VBS SET <SecureBindings> ":443:Site1.DNSName.com" ":443:Site2.DNSName.com"
  2. ChgList.vbs <SecureBindings> ":443:Site1.DNSName.com" ":443:Site2.DNSName.com" /INSERT

With ADSUTIL.VBS, you are simply stomping over the SecureBindings property with a new value that contains two LIST items. With my tool, you are inserting a new LIST item ahead of the matching item (so it will gracefully add a new LIST item to whatever LIST items are already there). Both actions should produce multiple LIST items and suffice for what you want to do.

//David