Retrieving User Active Directory Object using C# or VB .NET
The method retrieves an LDAPUser object, which is the object that represents the Active Directory object. The object contains methods and properties related to an Active Directory user.
ASP.NET, C#, VB.Net, Visual Studio 2010, Visual Sutdio 2012
Parameters: UserProperty (Username or Email) ,
(string) Property Value
The UserProperty method indicates how the wrapper should search for the user. The options here are Username or Email.
An instance of the LDAPmanager must be instantiated for a valid ADDS server,
and the instance must be logged on.
The method is called passing the Username or the email address as a string. Three
things can then occur:
- If the user detail exist and the method returns a LDAPUser object
- If the username does not exist the
method returns false
- An Exception will be thrown for other errors
Where LdapConnection is an instance of LdapManager
public LdapUser GetUser(String Username)
return LdapConnection.GetUser(UserProperty.Username, Username);
The returned LDAPUser object is updatable