This is what I use passing in the DirectoryEntry object as a paramater.
public static bool CheckAccountDisabled(DirectoryEntry de)
{
int ACCOUNTDISABLE = 0x0002;
int flags = (int)de.Properties["userAccountControl"].Value;
if (((flags & ACCOUNTDISABLE) == ACCOUNTDISABLE))
{
return true;
}
return false;
}
modified on Thursday, June 25, 2009 6:02 PM