title: System.DirectoryServices.AccountManagement.PrincipalCollection - how to check if principal is a user or a group?
body: <p>Consider the following code:</p>
  
  <pre><code>GroupPrincipal gp = ... // gets a reference to a group
  
  foreach (var principal in gp.Members)
   {
         // How can I determine if principle is a user or a group?         
   }
  </code></pre>
  
  <p>Basically what I want to know is (based on the members collection) which members are users and which are groups. Depending on what type they are, I need to fire off additional logic. </p>