Introduction
Objects
Object Properties
Introduction
DirectoryEntry Class
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
References
|
public static void DisableUserAccount(DirectoryEntry oDE)
{
//we disable the account by resetting all the default properties
oDE.Properties["userAccountControl"][0]=DotnetAD.ADAccountOptions.UF_NORMAL_ACCOUNT|DotnetAD.ADAccountOptions.UF_DONT_EXPIRE_PASSWD|DotnetAD.ADAccountOptions.UF_ACCOUNTDISABLE;
oDE.CommitChanges();
// oDE.Invoke("accountDisabled",new Object[]{"true"});
oDE.Close();
}
|