Tuesday, September 11, 2007

VBScript to Create IIS Application Pool

strAppPool = "MYNEWAPPPOOL"
Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
Set objAppPool = objAppPools.Create("IIsApplicationPool", strAppPool)

' 0 = Local System
' 1 = Local Service
' 2 = Network Service
' 3 = Custom Identity -> also set WAMUserName and WAMUserPass
objAppPool.AppPoolIdentityType = 3

' Note:WamUserName must be added to the IIS_WPG group to have correct security rights

objAppPool.WAMUserName = "USERNAME"
objAppPool.WAMUserPass = "PASSWORD"

objAppPool.SetInfo

No comments: