Intune custom ADMX cheat sheet

Asher Jebbink
2 min readJan 9, 2023

An ultra simple custom ADMX template, how to define common value types, and how to set those values in Intune.

ADMX Template

<?xml version="1.0" encoding="utf-8"?>
<policyDefinitions revision="1.0" schemaVersion="1.0">
<policyNamespaces>
<target prefix="CustomADMX" namespace="Organisiation.Policies" />
</policyNamespaces>
<resources minRequiredRevision="1.0" />
<categories>
<category name="ParentCategory" displayName="ParentCategory" />
<category name="Child1" displayName="Child1">
<parentCategory ref="ParentCategory" />
</category>
</categories>
<policies>
<!-- Policies go here. See below. -->
</policies>
</policyDefinitions>

Note some of the placeholder text/items above: <target> prefix and namespace, and the <categories>

Within the <policies> tags add your policies:

Text (string)

Creates a REG_SZ.

ADMX XML:

<policy name="TextValueExample" class="User" displayName="TextValueExample" explainText="Example text">
<parentCategory ref="Child1" />
<supportedOn ref="windows:SUPPORTED_Windows7" />
<elements>
<text id="TextValueExample" key="Software\ADMXExample" valueName="ExampleTextKeyName" />
</elements>
</policy>

Intune OMA-URI configuration value:

<enabled/>
<data id="TextValueExample" value="Some example text"/>

Decimal

ADXM XML:

<policy name="DecimalValueExample" class="User" displayName="DecimalValueExample" explainText="Example decimal">
<parentCategory ref="Child1" />
<supportedOn ref="windows:SUPPORTED_Windows7" />
<elements>
<decimal id="DecimalValueExample" key="Software\ADMXExample" valueName="ExampleDecimalKeyName" />
</elements>
</policy>

Intune OMA-URI configuration value:

<enabled/>
<data id="DecimalValueExample" value="123456"/>

Boolean (Example 1)

This example allows you to configure a single registry item slightly differently compared to how text, decimal, etc are configured. By ‘enabling’ or ‘disabling’ the policy itself you can also apply a value at the same time without having to specify any <elements>

ADMX XML:

<policy name="BooleanValueExample1" class="User" displayName="BooleanValueExample1" explainText="Example boolean 1" key="Software\ADMXExample" valueName="ExampleBooleanKeyName1">
<parentCategory ref="Child1" />
<supportedOn ref="windows:SUPPORTED_Windows7" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>

Intune OMA-URI configuration value:

<enabled/>

Boolean (Example 2)

This example applies 2 registry items. The first part is just like the Boolean example #1 (above) and enables the parent policy (BooleanValueExample2). The policy then contains a child element (BooleanExample2Child) which allows a boolean value, too.

The two boolean examples are given to show the two different ways you can define a boolean depending on whether you want to add a boolean value as one element in a list of other elements, or in the more simpler scenarios: creating 1 registry key only.

ADMX XML:

<policy name="BooleanValueExample2" class="User" displayName="BooleanValueExample2" explainText="Example boolean 1" key="Software\ADMXExample" valueName="ExampleBooleanKeyName2">
<parentCategory ref="Child1" />
<supportedOn ref="windows:SUPPORTED_Windows7" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
<elements>
<boolean id="BooleanExample2Child" valueName="BooleanExample2Child" >
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
</elements>
</policy>

Intune OMA-URI configuration value:

<enabled/> <!-- Enables the parent, creating the 1st reg key-->
<data id="BooleanExample2Child" value="true"/> <!-- Configures the child/2nd reg key-->

--

--