.NET Active Directory Wrapper Lite
.Net Active Directory Lite is a free package of two Visual Studio solutions (.sln) that includes all the source code to calling multiple Active Directory function and a complete sample application that demonstrates the functionality of the wrapper. Both solutions are written in C# and are combatible with both .Net Framework 1.1, 2.0 and 3.0.
The first Visual Studio Solution is a Class Library application. The output binary files contain one dll that facilitates calling of Active Directory functions from your code. Please see below for sample usage.
The second Visual Studio Solution is a Windows application. This application uses the output DLL that is generated by the Class Library application and demonstrates how the component should be used.
Configuration of the component is easy. Four parameters need to be set in code: The Active Directory domain that needs to be accessed, the username of the account that has permissions to execute Active Directory functions and the password for that account and finally the name or IP address of the domain controller. After that, calling functions is straight forward.
How it Works
In order to communicate with Active Directory all connection information should be provided:
- Domain Name
- Domain Computer Name/IP
- Administrator Username
- Administrator Password
|Application Function |
||Creates a new user
||Returns True or False depending on whether the user exists in Active Directory or not
||Enables the account of the Active Directory user provided
||Disables the account of the Active Directory user provided
||Changes the password of the given user with a new password
||Adds the given user to a given user group.
How to use the class functions
DotnetAD.ADAdminUser = "administrator";
DotnetAD.ADAdminPassword = "password";
DotnetAD.ADFullPath = "LDAP://" + "domain.com";
DotnetAD.ADServer = "192.168.0.1";
Adding a user
DirectoryEntry user = DotnetAD.CreateNewUser(this.TxtUsername.Text);
Checking if user exists
Adding a user to a group
Enabling an Active Directory user
Disabling an Active Directory user
Set an Active Directory user's password