Retreiving Organization Unit Object From Active Directory using C# or VB .Net
The method retrieves an updatable Organization Unit object.
Langauges Supported
ASP.NET, C#, VB.Net, Visual Studio 2010, Visual Sutdio 2008
Method: GetOrgUnit
Parameters: (string) Organization Unit Name
Precondition
An instance of the LDAP manager must be instantiated for a valid ADDS server
and logged in.
Functionality
The method is called passing the Organization Unit as a string. Three
things can then occur:
- If the Organization Unit exists and the method returns an LdapOU
object..
- If the Organization Unit does not exist the method return a null object
- An Exception will be thrown for other errors
Example
Where LdapConnection is an instance of LdapManager
public LdapOU GetOrgUnit(String ouName)
{
try
{
return LdapConnection.GetOU(ouName);
}
catch (Exception)
{
throw;
}
}
Post Condition
The retrieved object has two methods GetOUs and GetUsers
|