title: What is the new method of querying the metabase in IIS 7?
body: <p>In IIS 6, I typically used code to query the metabase as in the following:</p>
  
  <pre><code>var entry = new DirectoryEntry("IIS://localhost/W3SVC");
  foreach (DirectoryEntry site in entry.Children)
  {
  // Blah
  }
  </code></pre>
  
  <p>Now in IIS 7, this only functions if IIS 6 compatibility is installed.  What I'd really like to do is use the recommended IIS 7 way of doing things.</p>
  
  <p>My question is this.  What is the "proper" way to get information from the IIS 7 metabase on a local or remote machine in code without requiring IIS 6 compatibility mode?</p>