{"id":26578188,"url":"https://github.com/binbash23/active_directory_uac_decoder","last_synced_at":"2026-05-03T13:35:18.402Z","repository":{"id":251001798,"uuid":"836107256","full_name":"binbash23/active_directory_uac_decoder","owner":"binbash23","description":"Decode the User Account Control number from the active directory LDAP and create multiple db columns from it","archived":false,"fork":false,"pushed_at":"2024-07-31T07:36:41.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-31T08:32:30.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binbash23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T07:00:29.000Z","updated_at":"2024-07-31T08:32:35.995Z","dependencies_parsed_at":"2024-07-31T08:32:35.475Z","dependency_job_id":"0cfbfacf-5c3c-4242-8bc2-7e82e5108579","html_url":"https://github.com/binbash23/active_directory_uac_decoder","commit_stats":null,"previous_names":["binbash23/active_directory_uac_decoder"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbash23%2Factive_directory_uac_decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbash23%2Factive_directory_uac_decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbash23%2Factive_directory_uac_decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbash23%2Factive_directory_uac_decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binbash23","download_url":"https://codeload.github.com/binbash23/active_directory_uac_decoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056554,"owners_count":20553854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T04:28:05.449Z","updated_at":"2026-05-03T13:35:13.378Z","avatar_url":"https://github.com/binbash23.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nDecode the User Account Control number from the active directory LDAP and create multiple db columns from it\n\n\nI export the AD data with a script (see and modify: [ad_crawler.ps1](https://github.com/binbash23/active_directory_uac_decoder/blob/master/ad_crawler.ps1)) into 3 csv files (user, group, relation). Then I import them into database tables with a visual studio SSIS project (which is not included here).\n\nOne of the LDAP columns/fields is \"useraccountcontrol\" which contains a number. The number holds encoded information about the accounts \"User Account Control\". \nIf you want to know some detail about the encoding, have a look [here](https://jeremy-heer.github.io/uac-converter/uac-converter/).\nIf you want to decode the number into multiple flag-columns, you can do it with bitwise and operations like this:\n\n```\nselect\n         -- ... other AD columns \n         ,[useraccountcontrol] as [User Account Control]\n\t ,case when (useraccountcontrol \u0026 1) \u003e 0 then 1 else 0 end as SCRIPT\n\t ,case when (useraccountcontrol \u0026 2) \u003e 0 then 1 else 0 end as ACCOUNTDISABLE\n\t ,case when (useraccountcontrol \u0026 4) \u003e 0 then 1 else 0 end as RESERVED\n\t ,case when (useraccountcontrol \u0026 8) \u003e 0 then 1 else 0 end as HOMEDIR_REQUIRED\n\t ,case when (useraccountcontrol \u0026 16) \u003e 0 then 1 else 0 end as LOCKOUT\n\t ,case when (useraccountcontrol \u0026 32) \u003e 0 then 1 else 0 end as PASSWD_NOTREQD\n\t ,case when (useraccountcontrol \u0026 64) \u003e 0 then 1 else 0 end as PASSWD_CANT_CHANGE\n\t ,case when (useraccountcontrol \u0026 128) \u003e 0 then 1 else 0 end as ENCRYPTED_TEXT_PWD_ALLOWED\n\t ,case when (useraccountcontrol \u0026 256) \u003e 0 then 1 else 0 end as TEMP_DUPLICATE_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 512) \u003e 0 then 1 else 0 end as NORMAL_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 2048) \u003e 0 then 1 else 0 end as INTERDOMAIN_TRUST_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 4096) \u003e 0 then 1 else 0 end as WORKSTATION_TRUST_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 8192) \u003e 0 then 1 else 0 end as SERVER_TRUST_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 65536) \u003e 0 then 1 else 0 end as DONT_EXPIRE_PASSWORD\n\t ,case when (useraccountcontrol \u0026 131072) \u003e 0 then 1 else 0 end as MNS_LOGON_ACCOUNT\n\t ,case when (useraccountcontrol \u0026 262144) \u003e 0 then 1 else 0 end as SMARTCARD_REQUIRED\n\t ,case when (useraccountcontrol \u0026 524288) \u003e 0 then 1 else 0 end as TRUSTED_FOR_DELEGATION\n\t ,case when (useraccountcontrol \u0026 1048576) \u003e 0 then 1 else 0 end as NOT_DELEGATED\n\t ,case when (useraccountcontrol \u0026 2097152) \u003e 0 then 1 else 0 end as USE_DES_KEY_ONLY\n\t ,case when (useraccountcontrol \u0026 4194304) \u003e 0 then 1 else 0 end as DONT_REQ_PREAUTH\n\t ,case when (useraccountcontrol \u0026 8388608) \u003e 0 then 1 else 0 end as PASSWORD_EXPIRED\n\t ,case when (useraccountcontrol \u0026 16777216) \u003e 0 then 1 else 0 end as TRUSTED_TO_AUTH_FOR_DELEGATION\n\t ,case when (useraccountcontrol \u0026 67108864) \u003e 0 then 1 else 0 end as PARTIAL_SECRETS_ACCOUNT\n\nfrom\n         [your_table_that_stores_the_ad_information]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinbash23%2Factive_directory_uac_decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinbash23%2Factive_directory_uac_decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinbash23%2Factive_directory_uac_decoder/lists"}