title: Can I use DirectoryEntry to list sites within IIS Express
body: <p>I am on Windows XP.  We have Windows 2008 Servers.  Need to run IIS Express until we get workstations or virtual machines with newer version of local O.S. for the real IIS 7.X.</p>
  
  <p>Can I use DirectoryEntry to list my Sites and Virtual Directories when I run c# code under IIS Express?  I have examples for setting up the Virtual Directories under IIS Express so that I think I have covered.  Now I want to list them to ensure they exist.</p>
  
  <p>Anyone know how to do this in C#?  Just a small snippet of what I have been trying causes com exceptions...</p>
  
  <pre><code>DirectoryEntry iisServer = new DirectoryEntry("IIS://localhost/W3SVC/1");
  DirectoryEntry folderRoot = iisServer.Children.Find("Root", "/");
  var children = folderRoot.Children;
  </code></pre>