.NET Active Directory Wrapper    
Access Active Directory From Your C# or VB .Net Code
 

How to check to see if a user is in group or nested group

   1:              LdapManager myLDAP = new LdapManager("192.168.1.40");
   2:   
   3:              if (!myLDAP.Login("administrator", "Passw0rd2"))
   4:              {
   5:                  label1.Text = "Invalid Login";
   6:                  return;
   7:   
   8:              }
   9:   
  10:              LdapUser oUser = myLDAP.GetUser(UserProperty.Username, "linda");
  11:   
  12:              if (oUser.IsInGroup("groupA"))
  13:              {
  14:                  label1.Text = "User is in groupA";
  15:              }
  16:              else
  17:              {
  18:                  label1.Text = "NOT IN GROUP";
  19:              }