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

Creating a Group in Active Directory using C# or VB .Net

It is possible to create a new Active Directory group using the LDAPManager

Method: CreateGroup

Parameters:  (string) Group name, (string) Group description, (overload) (string) Group Type

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 Active Directory server and must be logged in.


The method is called passing the Group name as a string. Three things can then occur:

  1. If the Group is created and the method returns a Group object.
  2. If the Group name already exists the method throws an error.
  3. An Exception will be thrown for other errors


Where LdapConnection is an instance of LdapManager

public Boolean CreateGroup(String group, String groupDescription)
            /* There is an overload third parameter of Group type*/
                LdapGroup ldapGroup = LdapConnection.CreateGroup(group, groupDescription);
                return true;
            catch (Exception)

Post Condition

On success the method returns a valid group object.