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

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Shiva (shiva_sm_at_online.excite.com)
Date: 10/02/04


Date: Sat, 2 Oct 2004 21:54:03 +0530

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.

"Stu" <s.lock@cergis.com> wrote in message
news:#LhvYEHqEHA.3172@TK2MSFTNGP10.phx.gbl...
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



Relevant Pages

  • Re: Reading the IIS metabase to list all virtual servers...
    ... > One option is to use System.DirectoryServices namespace types. ... > foreach (DirectoryEntry c in root.Children) ... The IIS6 metabse is nice and easy as ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Active Directory query doesnt work...
    ... bool ergebnis = false; ... foreach (SearchResult table in search.FindAll()) ... using (DirectoryEntry user = sr.GetDirectoryEntry()) ...
    (microsoft.public.dotnet.languages.csharp)
  • System.DirectoryServices questions
    ... DirectoryEntry is used to connect to Active Directory. ... The problem is how am I supposed to test whether a connection is active or not if I can create a DirectoryEntry with whatever data I want since the data really isn't verified until I try to use it? ... SearchResultCollection results = mySearcher.FindAll; ... foreach { ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Checking to see if a user is a domain Administrator
    ... Here is some code that would list all the users in the Administrators ... object members = group.Invoke; ... foreach(object member in (IEnumerable) members) ... DirectoryEntry x = new DirectoryEntry; ...
    (microsoft.public.dotnet.languages.csharp)