I'm trying to assign application pool to one web site in IIS7 using vb script:
' Connect to the WMI WebAdministration namespace.'
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Retrieve the application and display its Web site name and path.'
Set oApp = oWebAdmin.Get("Application.SiteName='Default Web Site',Path='/site'")
' Specify a new application pool name and save it.'
oApp.ApplicationPool = "NewAppPool"
oApp.Put_
the above script is not working!
Is there is a better way to assign application pool to web site under IIS (Using script)?