|
Hi everyone,
I'm a non-programmer who has been given the task at work of updating a utility to work with IIS 7.0 that configures IIS read/script/execute permissions on applications and folders within those applications.
I have figured out how to 'grab' a Site, an Application, and also a Virtual Directory.
However, I am still at a loss as to how to grab a Folder (ie. from IIS Manager, you have Default Web Site -> your ApplicationX -> folders inside this application...Data, Images, etc)
I am coding this in VB, although I would take help in pretty much any language :)
Once I can get a hold of the object in a variable, I have no problems setting the permissions. This is a sample of grabbing an application object, and changing its IIS permissions:
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
Set oApp = oWebAdmin.Get("Application.SiteName='Default Web Site',Path='MyApplication'")
Call oApp.GetSection("HandlersSection", oHandlersSection)
oHandlersSection.AccessPolicy = 517 (read, execute, script)
If I could just figure out how to get a folder into a variable, I could run the last two lines of code to set individual permissions for that folder.
Does anyone know how to programmatically get a hold of a folder (not a virtual directory) through the WebAdministration interface?
Thanks for your help,
Sam
|