Microsoft KB Archive/323639

= How to create custom administrative templates in Windows 2000 =

Article ID: 323639

Article Last Modified on 3/27/2007

-

APPLIES TO


 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Server

-



This article was previously published under Q323639



IN THIS TASK
SUMMARY
 * How to Create a Group Policy Object
 * How to Create an Administrative Template
 * How to Load the Administrative Template
 * Example
 * Troubleshooting

REFERENCES



SUMMARY
This step-by-step article describes how to create custom Administrative Templates to use with Group Policy settings in a Windows 2000-based domain.

Group Policy templates provide an interface that you can use to apply registry changes to the target computer. Unlike policy settings that you create in Microsoft Windows NT 4.0, if you use Group Policy to apply registry changes, you can make these registry changes non-persistent. This means that when you log off the computer or when you shut down the computer, the policy settings are removed. To create non-persistent policy settings, you must create the registry changes on the target computer in one of the following registry locations:  For computer policy settings:

-or-

 For user policy settings:

-or-



Microsoft recommends that you copy the registry structure of the existing component when you create the Administrative Template. For example, you may want to modify a component in the following registry location:

In this situation, create an Administrative Template that references the following registry location:

NOTE: If Group Policy changes the target computer's registry in a location other than one of these locations, these changes are persistent. These changes are not removed when you log off the computer or when you shut down the computer. This behavior is also known as &quot;tattooing&quot; the registry.

Although you can edit the Administrative Templates that are included with Windows 2000, Microsoft recommends that you either create a new template or edit a copy of an existing Administrative Template. You must do so because the existing templates may have been updated or changed if you installed service packs or other updates to Windows.

back to the top

How to Create a Group Policy Object
To create a Group Policy object (GPO) in which to import a custom Administrative Template:
 * 1) Click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
 * 2) In the console tree, right-click the domain or the organizational unit in which you want to create the Group Policy setting, and then click Properties.
 * 3) Click the Group Policy tab, and then click New.
 * 4) Type a name for this Group Policy setting (for example, custom registry policy ), and then press ENTER.
 * 5) Click Close.

back to the top

How to Create an Administrative Template

 * 1) Start Notepad or another text editor, and then type the Administrative Template information.
 * 2) Save the file in the  \Inf folder, and then give it an .adm file name extension.
 * 3) Quit the text editor program.

back to the top

How to Load the Administrative Template

 * 1) Click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.
 * 2) Right-click the domain or the organizational unit that you want to configure, and then click Properties.
 * 3) Click the Group Policy tab, click the Group Policy setting that you want to edit, and then click Edit.
 * 4) Under either Computer Configuration or User Configuration, right-click Administrative Templates, and then click Add/Remove Templates.
 * 5) Click Add, click the template that you want to add, and then click Open.
 * 6) Click Close.

back to the top

Example
The following example describes how to create a custom Administrative Template:  Start Notepad.  Type the following code: CLASS USER ;This modifies the HKEY_CURRENT_USER portion of the registry CATEGORY !!categoryname
 * the following command creates a node called Desktop Settings
 * under User Configuration.

KEYNAME &quot;SOFTWARE\Policies\System&quot;
 * the following command specifies the registry key to modify

POLICY !!policyname
 * the following command specifies the name of the policy
 * by using the variable &quot;policyname&quot;

EXPLAIN !!explaintext
 * the following command specifies text on the Explain tab

PART !!labeltext DROPDOWNLIST REQUIRED VALUENAME &quot;NoDriveTypeAutoRun&quot;
 * the following command creates a PART that contains a list box
 * the following statement specifies the registry value to modify

ITEMLIST NAME !!no_cd VALUE NUMERIC 181 DEFAULT NAME !!no_drives VALUE NUMERIC 255 END ITEMLIST END PART END POLICY END CATEGORY
 * the following statement populates the drop down list

[strings] categoryname=&quot;Desktop Settings&quot; policyname=&quot;Disable the autoplay feature&quot; explaintext=&quot;This policy disables the autoplay feature on the selected drive(s)&quot; labeltext=&quot;Disable autoplay on&quot; no_cd=&quot;CD-ROM drives&quot; no_drives=&quot;All drives&quot;  On the File menu, click Save As. In the Save as type box, click All Files.</li> Type windows_folder\inf\example.adm in the File name box, and then click Save.</li> Quit Notepad.</li> Click Start, point to Programs, point to Administrative Tools, and then click Active Directory Users and Computers.</li> Right-click the domain, and then click Properties.</li> Click the Group Policy tab, click New, type test policy in the New Group Policy Object box, and then press ENTER.</li> Click Edit, right-click Administrative Templates under User Configuration, and then click Add/Remove Templates.</li> Click Add, click Example.adm, and then click Open.</li> After &quot;Example&quot; appears in the Current Policy Templates list, click Close.</li> Under User Configuration, expand Administrative Templates, and then click the new Desktop Settings node.</li> In the right pane, double-click the Disable the autoplay feature policy.
 * the following strings section assigns character strings
 * to the variable names specified in the previous section

Note: If your new policy setting does not appear in the right pane as you expect, right-click the new Desktop Settings node, point to View, and then click to clear the check mark that is beside the Show Policies Only menu item.</li> Click Enabled, and then make sure that the policy setting contains the features that you specified in the sample code.</li></ol>

back to the top

Troubleshooting
In some cases, you may not be able to determine the registry path to use to create an Administrative Template. You can use registry monitoring utilities for this purpose. For additional information about the Regmon tool, visit the following Sysinternals Web site:

http://www.microsoft.com/technet/sysinternals/default.mspx

Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

back to the top

<div class="references_section">