Поделиться через


Referencing the Windows Base ADMX File

Applies To: Windows Server 2008

The Windows base file, windows.admx, provides predefined categories and supported on text for Windows products. This section provides information about referencing the definitions from the windows.admx file for use in your .admx file

Referring to the Windows base file

The Windows base file is referred to using the unique namespace, Microsoft.Policies.Windows. The namespace string is case sensitive.

To refer to the Windows base file, include the using element in your policyNamespaces element. The namespace attribute must match the defined namespace from the Windows base file. Even though the prefix attribute can be any name that is unique within your .admx file, it is recommended you use the prefix attribute string from the Windows base file to avoid confusion.

For example, this XML fragment from the example2.admx file both defines its namespace and refers to the Windows Base file within the policyNamespaces element.

<policyNamespaces>
  <target prefix="example2" namespace="Microsoft.Policies.Example2" />
  <using prefix="windows" namespace="Microsoft.Policies.Windows" />
</policyNamespaces>

Referencing Windows category elements

You can display your category node or a policy setting under an existing Windows component node of the Group Policy Object Editor or the Group Policy Management Console. To accomplish this, you must reference the category elements in the Windows base file. Windows base file category elements can be used as the parentCategory element for any category element or policy element within your .admx file. If you define the category element name within your own .admx file instead of referencing the Windows base file, the Group Policy Object Editor or Group Policy Management Console will display a duplicate node. This happens because a category element defined in a different namespace is evaluated as a unique element by the Group Policy Object Editor. Because each .admx file is created in a unique namespace, this will result in duplicate nodes.

To place your category node under an existing node from the Windows base file, add the "windows:" prefix to the ref attribute of the parentCategory element.

This XML fragment demonstrates placing your sample category under the parentCategory based on the Windows base file category element. In the Group Policy Object Editor, this is equivalent to displaying your sample category node under an existing Windows component node.

    <category name="SAMPLE" displayName="$(string.SAMPLE)" explainText="$(string.SAMPLEHELP)">  
       <parentCategory ref="windows:WindowsComponents" />
    </category>

This XML fragment demonstrates placing your sample policy setting under the parentCategory based on the Windows base file category element. In the Group Policy Object Editor, this is equivalent to displaying your sample policy setting under an existing Windows component node.

    <policy name="Sample_NoParamPolicy" class="Both" displayName="$(string.Sample_NoParamPolicy)" explainText="$(string.Sample_NoParamPolicy_Help)" key="Software\Policies\Examples" valueName="Example1NoParam">
      <parentCategory ref="windows:WindowsComponents" />
      <supportedOn ref="SUPPORTED_ProductOnly" />
      <enabledValue>
        <decimal value="1" />
      </enabledValue>
      <disabledValue>
        <decimal value="0" />
      </disabledValue>
    </policy>

Referencing Windows supportedOn elements

Windows product names support information is provided in the Windows base file. You can reference these product names for your .admx file. In order to use the supported on information in the Windows base file, you must do the following:

  • Within your supportedOn element, add the "windows:" prefix to the ref attribute to reference the Windows base file.

  • Reference a defined supportedOn element from the Windows base file. If you use an invalid element name, the Group Policy Object Editor will not display any supported on information and will not display an error message.

This XML fragment demonstrates referencing supported on text for your policy setting, using existing Windows product information.

    <policy name="Sample_NoParamPolicy" class="Both" displayName="$(string.Sample_NoParamPolicy)" explainText="$(string.Sample_NoParamPolicy_Help)" key="Software\Policies\Examples" valueName="Example1NoParam">
      <parentCategory ref="SAMPLE" />
      <supportedOn ref="windows:SUPPORTED_WindowsXP" />
      <enabledValue>
        <decimal value="1" />
      </enabledValue>
      <disabledValue>
        <decimal value="0" />
      </disabledValue>
    </policy>