.NET Active Directory Wrapper

   Access Active Directory From Your Code

View DotNet Active Directory Wrapper Plus Demo
 

Active Directory
Introduction
Objects
Object Properties

DirectoryServices Namespace
Introduction
DirectoryEntry Class

How to .. in C# .NET
Create User
Disable User
Enable User
Authenticate a User
Change User Password
Get DirectoryEntry of a user
Get Users in a Group
Get Object Property

Other Resources
References

Creating a New User in Active Directory

public static DirectoryEntry CreateNewUser(string cn)
{
//set the LDAP qualification so that the user will be created under the Users
//container
string LDAPDomain ="/CN=Users," + GetLDAPDomain();
DirectoryEntry oDE= GetDirectoryObject(LDAPDomain);
DirectoryEntry user = oDE.Children.Add("CN=" + cn, "user");

//Must commit changes to initially create user
user.CommitChanges();

oDE.Close();
oDE.Dispose();

return user;

}