Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy way to read UserAccountControl flags #42

Open
rklec opened this issue May 28, 2024 · 0 comments
Open

Easy way to read UserAccountControl flags #42

rklec opened this issue May 28, 2024 · 0 comments

Comments

@rklec
Copy link

rklec commented May 28, 2024

It wold be great, if there was an easy way to read UserAccountControl. I know you probably can read them as an int and convert them with the magic numbers etc. However, that requires me to maintain custom logic for that, which could be implemented in a library like this.

https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties

E.g. like this to define a start for the most common ones:

/**
 * <summary><see href="https://learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties"/></summary>
 */
[Flags]
public enum UserAccountControlFlags
{
    ACCOUNTDISABLE = 2,
    LOCKOUT = 16,
    PASSWORD_EXPIRED = 0x800000
}

Or see https://stackoverflow.com/questions/10231914/useraccountcontrol-in-active-directory?rq=3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant