- Aug
- 258
- 4
hello programmers,
I know there are several tools to extract informations from AD,
but I ask myself if I could decode the attribute UserAccountControl with TCC in-house means.
If I use ADFIND I get integer values as described here.
I would like to do something like this:
This is a rough-and-ready example. I just want to create a list of accounts with special attributes (set or not set).
The challenge is to decode the integer field into the property flags.
Any help would be appreciated.
btw:
just listening to "Dean Brown, Here"
I know there are several tools to extract informations from AD,
but I ask myself if I could decode the attribute UserAccountControl with TCC in-house means.
If I use ADFIND I get integer values as described here.
Code:
>adfind -f "objectcategory=person" -b ou=dv,ou=!ber,dc=company,dc=de useraccountcontrol -csv
"dn","useraccountcontrol"
"CN=test\, sap,OU=DV,OU=!BER,DC=company,DC=de","514" (NORMAL_ACCOUNT + disabled)
"CN=Berlin\, Willi,OU=Users,OU=DV,OU=!BER,DC=company,DC=de","66048" (NORMAL_ACCOUNT + DONT_EXPIRE_PASSWORD)
"CN=xxxxxxxxx\, Frank,OU=Users,OU=DV,OU=!BER,DC=company,DC=de","512" (NORMAL_ACCOUNT)
"CN=Test-User\, Tony,OU=people,OU=DV,OU=!BER,DC=company,DC=de","514" (NORMAL_ACCOUNT + disabled)
"CN=pwdtest\, frank,OU=DV,OU=!BER,DC=company,DC=de","514" (NORMAL_ACCOUNT + disabled)
Code:
do account in @adfind.out
set dn=%@word[",",0,%account]
set uac=%@unquote[%@word[",",1,%account]]
gosub check-uac
echo%dn:%@if[PASSWD_NOTREQD eq 1,yes,no],%@if[ACCOUNTDISABLE eq 1,yes,no]...
enddo
The challenge is to decode the integer field into the property flags.
Any help would be appreciated.
btw:
just listening to "Dean Brown, Here"
