-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels_ad.py
44 lines (40 loc) · 1.18 KB
/
models_ad.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import math
from enum import Enum
class ADModel(object):
def __init__(self):
self.FirstName = ""
self.AccountStatus = ""
self.AccountStatusDescription = []
def get_account_status(self):
value=self.AccountStatus
print(AccountStatus(2))
print(math.sqrt(544))
for status in reversed(AccountStatus):
if(value - status.value >= 0):
AccountStatusDescription.add(status)
value = value - status.value
class AccountStatus(Enum):
SCRIPT=1
ACCOUNTDISABLE=2
HOMEDIR_REQUIRED=8
LOCKOUT=16
PASSWD_NOTREQD=32
PASSWD_CANT_CHANGE=64
ENCRYPTED_TEXT_PWD_ALLOWED=128
TEMP_DUPLICATE_ACCOUNT=256
NORMAL_ACCOUNT=512
INTERDOMAIN_TRUST_ACCOUNT=2048
WORKSTATION_TRUST_ACCOUNT=4096
SERVER_TRUST_ACCOUNT=8192
DONT_EXPIRE_PASSWORD=65536
MNS_LOGON_ACCOUNT=131072
SMARTCARD_REQUIRED=262144
TRUSTED_FOR_DELEGATION=524288
NOT_DELEGATED=1048576
USE_DES_KEY_ONLY=2097152
DONT_REQ_PREAUTH=4194304
PASSWORD_EXPIRED=8388608
TRUSTED_TO_AUTH_FOR_DELEGATION=16777216
PARTIAL_SECRETS_ACCOUNT=67108864
adm = ADModel()
print(adm.get_account_status())