Creating a Group in Active Directory using C# or VB .Net
It is possible to create a new Active Directory group using the LDAPManager
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:
- If the Group is created and the method returns a Group object.
- If the Group name already exists the method throws an error.
- 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);
On success the method returns a valid group object.