Reading the IIS metabase to list all virtual servers...

S

Stu

Hi,

I am writing a windows forms app that needs to list all the virtual servers
and their respective log file paths. The IIS6 metabse is nice and easy as it
is XML.

Is there any way to reading these details from the IIS5 metabase - which
appears to be a binary format?

Thanks in advance,

Stu
 
S

Shiva

Hi,

One option is to use System.DirectoryServices namespace types. Here is a
sample:

-- Code Start --
DirectoryEntry root = new DirectoryEntry (@"IIS://localhost/W3SVC");
foreach (DirectoryEntry c in root.Children)
{
if (c.Properties["KeyType"][0].ToString() == "IIsWebServer")
Console.WriteLine (c.Properties["LogFileDirectory"][0].ToString());
}
-- Cod End --

I hope this is what you are looking for.

Hi,

I am writing a windows forms app that needs to list all the virtual servers
and their respective log file paths. The IIS6 metabse is nice and easy as it
is XML.

Is there any way to reading these details from the IIS5 metabase - which
appears to be a binary format?

Thanks in advance,

Stu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top