@@ -1092,12 +1092,7 @@ def find_delegation(self):
10921092 UF_TRUSTED_FOR_DELEGATION = 0x80000
10931093 UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = 0x1000000
10941094 UF_ACCOUNTDISABLE = 0x2
1095-
1096- def processAttributeValue (attribute ):
1097- # Extract the payload value from the AttributeValue object
1098- if hasattr (attribute , "payload" ):
1099- return str (attribute .payload )
1100- return str (attribute )
1095+ SERVER_TRUST_ACCOUNT = 0x2000
11011096
11021097 def printTable (items , header ):
11031098 colLen = []
@@ -1126,11 +1121,11 @@ def printTable(items, header):
11261121 self .logger .highlight (outputFormat .format (* row ))
11271122
11281123 # Building the search filter
1129- search_filter = ("(&(|(UserAccountControl:1.2.840.113556.1.4.803:=16777216 )"
1130- "(UserAccountControl:1.2.840.113556.1.4.803:=524288 )"
1124+ search_filter = (f "(&(|(UserAccountControl:1.2.840.113556.1.4.803:={ UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION } )"
1125+ f "(UserAccountControl:1.2.840.113556.1.4.803:={ UF_TRUSTED_FOR_DELEGATION } )"
11311126 "(msDS-AllowedToDelegateTo=*)(msDS-AllowedToActOnBehalfOfOtherIdentity=*))"
1132- "(!(UserAccountControl:1.2.840.113556.1.4.803:=2 ))"
1133- "(!(UserAccountControl:1.2.840.113556.1.4.803:=8192 )))" )
1127+ f "(!(UserAccountControl:1.2.840.113556.1.4.803:={ UF_ACCOUNTDISABLE } ))"
1128+ f "(!(UserAccountControl:1.2.840.113556.1.4.803:={ SERVER_TRUST_ACCOUNT } )))" )
11341129
11351130 attributes = ["sAMAccountName" , "pwdLastSet" , "userAccountControl" , "objectCategory" ,
11361131 "msDS-AllowedToActOnBehalfOfOtherIdentity" , "msDS-AllowedToDelegateTo" ]
0 commit comments