millhouse50
06-22-2006, 11:55 AM
I want to set the application pool that I make as the default application pool of the website that I create. Right now when I make the web site the default is <Invalid appPool> with <DefaultappPool> and <MyCappPool> in the drop down menu. I want to be able to have <MyCappPool> displayed as default when the script runs though. Also on a side note I was wondering how you can add multiple IP addresses to a website in scripting, not using the console. Any help would be greatly appreciated.
Set objSite = objWMIService.Get("IIsWebServerSetting='" & strSitePath & "'")
Set objVirtualDirectory = objWMIService.Get("IIsWebVirtualDirSetting='" & strSitePath & "/ROOT'")
' Application Pool Creation
strAppPool = "MyCAppPool"
Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
Set objAppPool = objAppPools.Create("IIsApplicationPool", strAppPool)
objAppPool.SetInfo
' Assign the Pool to the Site
objVirtualDirectory.AppPoolID = strAppPool
objVirtualDirectory.AppFriendlyName = "me app"
objVirtualDirectory.SetInfo
Set objSite = objWMIService.Get("IIsWebServerSetting='" & strSitePath & "'")
Set objVirtualDirectory = objWMIService.Get("IIsWebVirtualDirSetting='" & strSitePath & "/ROOT'")
' Application Pool Creation
strAppPool = "MyCAppPool"
Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
Set objAppPool = objAppPools.Create("IIsApplicationPool", strAppPool)
objAppPool.SetInfo
' Assign the Pool to the Site
objVirtualDirectory.AppPoolID = strAppPool
objVirtualDirectory.AppFriendlyName = "me app"
objVirtualDirectory.SetInfo