This simple VBScript load the host header configuration into an array and then add a list of Host Headers (e.g. www.mysite.com, www.vittorio.tk...) from a text file located into C:\NewHostHeader.txt
Dim IISOBJ, Bindings, Parts, BindingValue
Dim filesys, filetxt
'Get the mimemap object.
Set IISOBJ = GetObject("IIS://localhost/W3SVC/1")
Bindings= IISOBJ.ServerBindings
Index = UBOund(Bindings)
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile
("C:\NewHostHeader.txt", 1, True)
Do Until filetxt.AtEndOfStream
host = filetxt.Readline
Redim Preserve Bindings(index + 1)
Bindings(Index) = ":80:" & host
index = index + 1
Loop
filetxt.Close
IISOBJ.ServerBindings = Bindings
IISOBJ.SetInfo
0 commenti:
Post a Comment