tags:

views:

498

answers:

2

Hi,

I'm trying to run this script to assign Application Pool to web site running under IIS 6

Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
Set oSite = oWebAdmin.Get("Site.Name='Site'")
oSite.ApplicationDefaults.ApplicationPool = "NewAppPool"
oSite.Put_

This script can't run under IIS 6... Is there is something wrong?

Thanks,

A: 
Set objVirtualDirectory = GetObject( "IIS://localhost/" + strSitePath + "/ROOT" )


' Assign the Pool to the Site
objVirtualDirectory.AppPoolID = strAppPool
objVirtualDirectory.AppFriendlyName = "me app"
objVirtualDirectory.Put_()
MysticSlayer
A: 

Thanks for your reply,

How can I set strSitePath to the correct website?