![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Create website with multiple host headers I am trying to add multiple host headers to a new website I am creating. I am using VBScript and WMI to create the test site. The code below is taken from Microsoft's example of using the IIS WMI provider My question is if I wanted to add another host header how should it be done? Currently I get a "Subscript out of range error" when I try to add to the array. ' Make connections to WMI, to the IIS namespace on MyMachine, and to the WWW service. set locatorObj = CreateObject("Wbemscripting.SWbemLocator") set providerObj = locatorObj.ConnectServer("MyServer", "root/MicrosoftIISv2") set serviceObj = providerObj.Get("IIsWebService='W3SVC'") ' Build binding object, which is a required parameter of the CreateNewSite method. ' Use the SpawnInstance WMI method since we are creating a new instance of an object. Bindings = Array(0) Set Bindings(0) = providerObj.get("ServerBinding").SpawnInstance_() Bindings(0).IP = "" Bindings(0).Port = "80" Bindings(0).Hostname = "host-header-1" Bindings(1).IP = "" <== Added by me Bindings(1).Port = "80" <== Added by me Bindings(1).Hostname = "host-header-2" <== Added by me ' Create the new Web site using the CreateNewSite method of the IIsWebService object. Dim strSiteObjPath strSiteObjPath = serviceObj.CreateNewSite"MyNewSite",Bindings, "D:\Inetpub\VSERVER") |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Host Public Website on SBS 2008 Network | SBS Server | |||
| Website access among host and VPC | Virtual PC | |||
| local website access between in XP host and VPC | Virtual PC | |||
| create email headers using Windows Mail in Vista | Vista mail | |||
| Read-Host issue, won't store to variable when using multiple read-host lines | PowerShell | |||