Q:

Read, Add, Delete Windows users in .NET

I want to Read, Add and Delete users from a Windows using .NET code. How can I do that?

A:

Here's some sample code for creating a windows user:
public static bool CreateLocalWindowsAccount(string username, string password, string displayName, string description, bool canChangePwd, bool pwdExpires)
{
    try
    {
        PrincipalContext context = new PrincipalContext(ContextType.Machine);
        UserPrincipal user = new UserPrincipal(context);
        user.SetPassword(password);
        user.DisplayName = displayName;
        user.Name = username;
        user.Description = description;
        user.UserCannotChangePassword = canChangePwd;
        user.PasswordNeverExpires = pwdExpires;
        user.Save();

        //now add user to "Users" group so it displays in Control Panel
        GroupPrincipal group = GroupPrincipal.FindByIdentity(context, "Users");
        group.Members.Add(user);
        group.Save();

        return true;
    }
    catch (Exception ex)
    {
        MessageBox.Show("Error creating account: {0}", ex.Message);
        return false;
    }

}

Adding a reference to System.DirectoryServices will let you read all windows users doing something like this:
DirectoryEntry localMachine = new DirectoryEntry("WinNT://" + Environment.MachineName);
DirectoryEntry admGroup = localMachine.Children.Find("administrators", "group");
object members = admGroup.Invoke("members", null);
foreach (object groupMember in (IEnumerable)members)
{
    DirectoryEntry member = new DirectoryEntry(groupMember);
    lstUsers.Items.Add(member.Name);
}

The DirectoryServices Namespace in general should let you navigate and read the Active Directory

