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

Getting a list of All User Objects From Active Directory using C# or VB .Net

This method returns a collection of LdapUser objects that represent Active Directory users.

Langauges Supported

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

Method: GetUsers

Parameters:  there is an overloaded method: UserProperty (Username or Email), (string) Value


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


The method is called,optionally passing the parameters. Two things can then occur:

  1. The method returns a Collection of LdapUser Objects
  2. An Exception will be thrown for any errors


Where LdapConnection is an instance of LdapManager

public LdapUserCollection GetUsers()
            /* There is an overload to take a property */
                return LdapConnection.GetUsers();
            /*   return LdapConnection.GetUsers(UserProperty.Username,"Larry")   */
            catch (Exception)

Post Condition

The collection of LdapUser Objects may be updated