Urgent help needed!
I have been given the task of adding more than 350 Host Headers to one
particular IIS web site. Is there a way to put this in some kind of a script
to automate the process?

Thanks in advance

Re: Adding Host Headers with a Script by David

David
Fri Dec 10 08:26:32 CST 2004

You're in luck. I just posted a script tool to do exactly what you are
asking about.

http://blogs.msdn.com/david.wang/archive/2004/12/02/273681.aspx

You just need to:
1. Have a file called "headers.txt" which contains one host header name on
each line
2. Save the code from the blog as the tool name of your choice (such as
ChangeList.vbs)

Run this command:

FOR /F %I IN ( headers.txt ) DO @CSCRIPT //NoLogo ChangeList.vbs
w3svc/#SITE-ID#/ServerBindings LAST ":80:%I" /INSERT /COMMIT


It basically loops through "Headers.txt" one line at a time, calling the
script to append that entry into the ServerBindings of the specified SITE-ID
on port 80.

I presume you know what SITE-ID as well as the format of the ServerBinding
(IP:Port:HostHeader). If you want to be more fancy with the insertion of
host headers, consider reading help on the "FOR" command as it'll be able to
do it for you, assuming headers.txt contains the necessary info.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Mike" <Mike @discussions.microsoft.com> wrote in message
news:DFC5AB1D-6CA9-482B-928D-CE79E52609FE@microsoft.com...
Urgent help needed!
I have been given the task of adding more than 350 Host Headers to one
particular IIS web site. Is there a way to put this in some kind of a
script
to automate the process?

Thanks in advance