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

Retrieving List of Active Directory Groups using C# or VB .Net

This method returns groups and optionally takes a group as a parameter

Method: GetGroups

Parameters:  (Optional) (string) Group

Programming Languages Supported

ASP.NET, C#, VB.Net, Visual Studio 2010, Visual Sutdio 2012


An instance of the LDAP manager must be instantiated for a valid ADDS server and be logged in.


The method is called optionally passing a group as a string. Two things can then occur:

  1. A Collection of group objects is returned.
  2. An Exception will be thrown for other errors


Where LdapConnection is an instance of LdapManager

        public LdapGroupCollection GetGroups(String group)
            /* There is an overload for GroupName*/
                return LdapConnection.GetGroups();
            catch (Exception)


Post Condition

The collection of groups is updatable and the connection remains open.