Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/audibleblink/msldapuac
A golang package for retrieving values from the Microsoft LDAP property, `UserAccountControl`
https://github.com/audibleblink/msldapuac
activedirectory golang ldap microsoft msldap uac useraccountcontrol
Last synced: about 2 months ago
JSON representation
A golang package for retrieving values from the Microsoft LDAP property, `UserAccountControl`
- Host: GitHub
- URL: https://github.com/audibleblink/msldapuac
- Owner: audibleblink
- License: mit
- Created: 2020-04-25T19:15:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-28T01:22:28.000Z (about 3 years ago)
- Last Synced: 2024-06-19T05:37:59.197Z (7 months ago)
- Topics: activedirectory, golang, ldap, microsoft, msldap, uac, useraccountcontrol
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 15
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Microsoft LDAP UserAccountControl Parser
A package for retrieving values from the Microsoft LDAP property UserAccountControl
## Usage
```golang
import (
uac "github.com/audibleblink/msldapuac"
)uacProp := int64(514)
uac.ParseUAC(uacProp)
// => [ "NORMAL_ACCOUNT", "ACCOUNTDISABLE" ]propertyInt := uac.NormalAccount | uac.TrustedForDelegation
// => 524800uacField := int64(514)
accountIsDisabled := uac.IsSet(uacField, uac.Accountdisable)
// => true
```## Reference
https://support.microsoft.com/en-us/help/305144/
| Property | flag | Value |
| -- | -- | -- |
| SCRIPT | 0x0001 | 1 |
| ACCOUNTDISABLE | 0x0002 | 2 |
| HOMEDIR_REQUIRED | 0x0008 | 8 |
| LOCKOUT | 0x0010 | 16 |
| PASSWD_NOTREQD | 0x0020 | 32 |
| PASSWD_CANT_CHANGE | 0x0040 | 64 |
| ENCRYPTED_TEXT_PWD_ALLOWED | 0x0080 | 128 |
| TEMP_DUPLICATE_ACCOUNT | 0x0100 | 256 |
| NORMAL_ACCOUNT | 0x0200 | 512 |
| INTERDOMAIN_TRUST_ACCOUNT | 0x0800 | 2048 |
| WORKSTATION_TRUST_ACCOUNT | 0x1000 | 4096 |
| SERVER_TRUST_ACCOUNT | 0x2000 | 8192 |
| DONT_EXPIRE_PASSWORD | 0x10000 | 65536 |
| MNS_LOGON_ACCOUNT | 0x20000 | 131072 |
| SMARTCARD_REQUIRED | 0x40000 | 262144 |
| TRUSTED_FOR_DELEGATION | 0x80000 | 524288 |
| NOT_DELEGATED | 0x100000 | 1048576 |
| USE_DES_KEY_ONLY | 0x200000 | 2097152 |
| DONT_REQ_PREAUTH | 0x400000 | 4194304 |
| PASSWORD_EXPIRED | 0x800000 | 8388608 |
| TRUSTED_TO_AUTH_FOR_DELEGATION | 0x1000000 | 16777216 |
| PARTIAL_SECRETS_ACCOUNT | 0x04000000 | 67108864 |