I need to check whether an account in the active directory was enabled.
After some searching, I came to understand that the enabled feature is not only for User but for every node in the active directory. That means every DirectoryEntry instance.
Here is how you check if it is enabled
public const string AccountControl="userAccountControl"; public const int EnabledFlag= 0x2;static bool IsEnabled(DirectoryEntry de) { return (((int)de.Properties[AccountControl].Value)& EnabledFlag) == 0; }