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

  • Thread starter Thread starter Stu
  • Start date Start date
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
 
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
 
Back
Top