Article ID: 225087 - View products that this article applies to.
This article was previously published under Q225087
NoticeThis article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center
(http://support.microsoft.com/?scid=http%3a%2f%2fsupport.microsoft.com%2fwin2000)is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy
This article is a guide for writing custom ADM files for use with System Policy Editor. System Policy Editor's interface, comprised of all of the books, check boxes, and text boxes you see when you open a computer or user of group policy, is created with a template. The system policy template, or ADM file, is a simple program that instructs System Policy Editor what books, check boxes, and other input controls to present to the administrator.
For more information about writing an ADM file for group policy, see the white paper ("Implementing Registry-Based Group Policy") at the following Microsoft Web site:
Templates Specify the Registry ChangeThere are two default templates included when you install Windows NT. They are Common.adm and Winnt.adm. These files use the Class, Keyname, and Valuename variables to allow you to manipulate specific Windows NT policy activities on computers running Windows NT. The following is an explanation of these variables and how they can be used to create your own policy files.
Converting a Registry Change into ADM KeywordsThe biggest challenge may be finding a useful registry change that you want to distribute. For example, take the following change that allows you to move the printer spool folder. Remember that before you point the spool to a new folder, that folder must be created. You can then make the following change to the registry:
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/322756/ )How to back up and restore the registry in Windows
Creating an ADM FileADM files can be created with any text editor.
Create a file following the block-structure syntax of the *.adm language:
Loading the Template into System Policy Editor
Terms and AbbreviationsSystem Policy Editor (SPE): The tool needed to load the .pol file and apply .adm files.
ADM files: The templates used to change current registry settings.
!!Strings: The text variables in the .adm file.
CATEGORY: The "Books" of Policy Groupings.
POLICY: Used to create the check box entry needed to alter registry values.
PART: Used for the Input Control of the required policy.
The Winnt.adm file creates the interface used in the example above. The following list explains the keywords that create the interface.
!!STRINGS: The are several lines that begin with "!!". The "!!" denotes a string variable and is followed by the variables name, !!stringname. The strings are defined at the bottom of the policy template. If you scroll to the bottom of the file, you see a section similar to the following:
[strings]The variable !!SYSTEM in the body of the template maps to Windows NT System, which is visible in the interface. Having a section of strings allows the descriptions to be replaced easily. This is particularly useful when you translate the files into other languages. Otherwise, you may just want to embed the text in the body of the template.
System = Windows NT System
Login_Policies = Logon
LogonBanner_DefText = User created text
CATEGORY: This defines a grouping of similar policies. The CATEGORY keyword creates an expandable and collapsible book in the SPE interface, and CATEGORIES can nest within each other. CATEGORY is used solely for organizational purposes, and you can create as many or as few categories as you require.
POLICY: This keyword creates the check box entry which, if selected, creates an instruction for a registry change. If cleared, it creates an instruction for a different registry change (usually a deletion). If the check box is unavailable, it does not create an instruction in the policy file.
PARTs: Some registry changes are accomplished by implementing or clearing a policy. Other registry changes are more complex. For example, to create a logon banner (the policy), an administrator must indicate what goes in the title bar of the window and what goes in the body of the window. These additional pieces of information are gathered by the PARTs variable.
PART: This creates an input control in the lower part of the policy dialog box. A large variety of control windows can be created with this.
CATEGORY, POLICY, and PART create the backbone of the SPE interface. Each is a container. CATEGORY can contain categories and policies. POLICIES can contain parts. Because this is a structured programming language, when you begin one structure or container, you also need to end it.
END - END CATEGORY, END POLICY, and END PART: An END command is required to designate the end of each of the respective structures. You do not need to name the category that is ending. It is determined based on the nesting level. Starting and ending each container properly provides for the correct nested structures.
Types of PARTs: There are numerous types of PARTs, which allows you to be creative in designing system policies. For example, the logon banner caption and text are both text boxes. This input control is created with the keyword EDITTEXT, which itself is modified with the optional keywords MAXLEN (to designate the maximum length of input), and DEFAULT (to create a default, suggested data for the administrator's input). So the SPE interface is created with CATEGORIES, POLICIES, and PARTS. An administrator indicates preferences by implementing or clearing policies, and sometimes typing information into input controls called PARTs.
Article ID: 225087 - Last Review: November 27, 2007 - Revision: 3.7
Contact us for more help
Connect with Answer Desk for expert help.