This tool scans a Windows PolicyDefinitions directory (ADMX/ADML) and exports every policy definition into a structured JSON or YAML file. This was made for being able to quickly search for any string in LGPE to see the data/value/key/description. I personally used it in the win-config project for several options. This small parser project was inspired by the WindowsAdmxParser powershell module. However, since it's not entirely correct (sometimes KeyName is displayed instead of ValueName), the class is not inserted directly into KeyPath and KeyNames is not inserted directly into KeyPath.
- Automatically detects language folders, or use
--languageto use specific ones - Supports ignoring specific ADMX files, filtering by policy class (
Machine/User), category name, or free-text policy search - Generates pretty JSON (or YAML) by default,
--compressonly affects JSON exports - Moves the
Classdirectly into theKeyPath(HKLM,HKCU, both) - Every value includes its ADMX type in
ValueType(Decimal,LongDecimal,String,Delete) - Keeps the element attributes a write needs (list
Additive,ExplicitValue,ValuePrefix,Expandable, decimalMinValue/MaxValue/StoreAsText, textMaxLength, ...) - Adds meaning for
Supportedkeys (supported.txt)
- Python 3.8+
pip install pyyamlfor YAML output
python admx-parser.py [FLAGS]| Flag | Description | Default |
|---|---|---|
-d, --definitions PATH |
PolicyDefinitions directory | C:\Windows\PolicyDefinitions |
-l, --language LANG |
Include a language folder (repeatable) | Auto-detected + en-US |
-i, --ignore NAME |
Ignore an ADMX base name (repeatable), its categories stay if other files have policies under them | None |
--class {Machine,User} |
Restrict to policy class (repeatable) | All |
--category TEXT |
Filter by category substring | None |
--policy TEXT |
Filter by policy/display name substring | None |
--include-obsolete |
Include obsolete/deprecated policies | Off |
--format {json,yaml} |
Output format | json |
--compress |
Minified JSON (ignored for YAML) | Pretty |
--output PATH |
Custom destination file | policies.json/policies.yaml (in current dir) |
--categories-output PATH |
Custom destination for category metadata JSON (I use it for my website/app, if not trying to create a GUI using policies.json then this has no actual use) | policyCategories.json next to output |
-h, --help |
Shows flags from above | - |
# Default (pretty JSON)
python admx-parser.py
# YAML output, ignore inetres and WindowsUpdate ADMX files
python admx-parser.py --format yaml --ignore inetres --ignore WindowsUpdate
# Machine only policies under the Edge category, compressed JSON
python admx-parser.py --class Machine --category Edge --compress
# All policies + category JSON
python admx-parser.py --include-obsolete --output assets/policies.json --categories-output assets/policyCategories.json
# W11 25H2 V3.0 templates example
python admx-parser.py -d W11-25H2-V3-PolicyDefinitions -l en-US --include-obsolete --ignore inetres --ignore GroupPolicyPreferencesLogging --output assets/policies.json --categories-output assets/policyCategories.json
python admx-parser.py -d W11-25H2-V3-PolicyDefinitions -l en-US --include-obsolete --ignore inetres --ignore GroupPolicyPreferencesLogging --format yaml --output assets/policies.yaml{
"File": "AppPrivacy.admx",
"CategoryName": "AppPrivacy",
"CategoryKey": "AppPrivacy:AppPrivacy",
"PolicyName": "LetAppsAccessAccountInfo",
"Class": "Machine",
"NameSpace": "Microsoft.Policies.AppPrivacy",
"Supported": "Windows_10_0 - At least Windows Server 2016, Windows 10",
"DisplayName": "Let Windows apps access account information",
"ExplainText": "This policy setting specifies whether Windows apps can access account information.\n\nIf you enable this policy setting, Windows apps can access account information.",
"KeyPath": [
"HKLM\\Software\\Policies\\Microsoft\\Windows\\AppPrivacy"
],
"Elements": [
{ "Type": "Enum", "ValueName": "LetAppsAccessAccountInfo", "Items": [
{ "DisplayName": "User is in control", "ValueType": "Decimal", "Data": "0" },
{ "DisplayName": "Force Allow", "ValueType": "Decimal", "Data": "1" },
{ "DisplayName": "Force Deny", "ValueType": "Decimal", "Data": "2" }
]
}
]
},- File: AppPrivacy.admx
CategoryName: AppPrivacy
CategoryKey: AppPrivacy:AppPrivacy
PolicyName: LetAppsAccessAccountInfo
Class: Machine
NameSpace: Microsoft.Policies.AppPrivacy
Supported: Windows_10_0 - At least Windows Server 2016, Windows 10
DisplayName: Let Windows apps access account information
ExplainText: |-
This policy setting specifies whether Windows apps can access account information.
If you enable this policy setting, Windows apps can access account information.
KeyPath:
- HKLM\Software\Policies\Microsoft\Windows\AppPrivacy
Elements:
- Type: Enum
ValueName: LetAppsAccessAccountInfo
Items:
- DisplayName: User is in control
ValueType: Decimal
Data: '0'
- DisplayName: Force Allow
ValueType: Decimal
Data: '1'
- DisplayName: Force Deny
ValueType: Decimal
Data: '2'