Getting a all list of Active Directory users using C# or VB .Net

The LdapUser object can be updated via properties and methods

Langauges Supported

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

Method: GetUserList

Parameters:  none

Precondition

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

Functionality

The method is called without parameters.

  1. A string array of usernames is returned.
  2. An Exception will be thrown for other errors

Example

Where LdapConnection is an instance of LdapManager

        public String[] GetUserList()
        {
            try
            {
                return LdapConnection.GetUserList();
            }
            catch (Exception)
            {
                throw;
            }
        }

Post Condition

The String array is returned the AD connection remains connected.