I have a script that included below that will create an application pool, create a website using the application pool, change the anonymous user and enable ssl. The only problem with it is when you right click on the finish site and look at properties in IIS there is no SSL port specified. I need to find a way to script the SSL port to be 443 and add that entry under Host Headers (multiple ssl identies for the website). I have searched and cannot find this information. Does anyone here know how?
Thanks
Nick
*****************************************************************************************
Option Explicit
Dim sSiteID, sRegion, sWebSiteName, sOrgName, sIntIPAddress, objAppPools
Dim sWebPath, objIIS, strWebID, ObjServerBindings, objWebSite, objPublic
sSiteID = "12345"
sRegion = "US"
sIntIPAddress = "254.254.254.254"
sWebPath = "\\server\folder\" & sRegion & "\" & sSiteID & "\"
'Create Application Pool
Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
Set objAppPools = objAppPools.Create("IIsApplicationPool", sSiteID)
objAppPools.SetInfo
'Create Web Site
set objIIS = GetObject("IIS://localhost/W3SVC")
objServerBindings = Array(0)
objServerBindings(0) = sIntIPAddress & ":" & 80 & ":" & ""
strWebID = objIIS.CreateNewSite(sSiteID, objServerBindings, sWebPath)
WScript.Echo strWebID
'Sets Web Site Properties
set objWebSite = GetObject("IIS://localhost/W3SVC/" & strWebID)
objWebSite.AccessRead = True
ObjWebsite.AppPoolID = sSiteID
objWebsite.AccessScript = "True"
objWebsite.AppFriendlyName = sSiteID
objWebSite.SetInfo
'Sets Access Properties
objWebSite.AnonymousUserName = "domain\user"
objWebSite.AnonymousUserPass = "P@ssword"
objWebSite.AuthFlags = "1"
objWebSite.SetInfo
'Sets SSL on Public Directory
'set objPublic = GetObject("IIS://localhost/W3SVC/" & strWebID & "Public")
'objPublic.AccessSSLFlags = "264"
objWebSite.AccessSSLFlags = "264"
objWebSite.HttpErrors = "403,4,URL,/customerrors/" & sSiteID & ".htm"
objWebSite.SetInfo