4. Syntax for Updating the GPME Interface
The
.adm templates do more than just indicate the registry path, value, and
data that need to be updated. They also configure the interface of the
GPME. The interface configurations are essential because the GPME
interface is where the configurations are actually made.
Four main types of syntax create the interface within the Group Policy Management Editor:
STRINGS
CATEGORY
POLICY
PART
The
CATEGORY and POLICY syntaxes are the only required entries in the .adm
template, but the other two variables are important. The STRINGS syntax
is used extensively in the standard .adm templates, but it is seldom
used in custom .adm templates. The PART syntax is used when the
registry value or values being referenced require more than an ON or
OFF configuration.
4.1 STRINGS
The
STRINGS syntax is used to help organize and logically format the string
variables used within the .adm template. The STRINGS syntax is not
mandatory, but it can help reduce the code within the main body of the
.adm template to remove the clutter and make it easier to read. The
STRINGS syntax allows for variables to be used for lengthy strings.
Strings are used to create the interface within the GPME. The following
example uses the STRINGS syntax whenever there is a string variable to
create the interface.
CLASS MACHINE
CATEGORY !!CUSTOMADM
POLICY !!Autologon
KEYNAME "SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon"
PART !!Username
EDITTEXT
VALUENAME "autoadminlogon"
END PART
PART !!Password
EDITTEXT
VALUENAME "defaultpassword"
END PART
END POLICY
END CATEGORY
[STRINGS]
CUSTOMADM = "Microsoft Custom ADM Entries"
AutoLogon = "Automatic Logon"
Username = "What is the name of the user?"
Password = "What is the user's password?"
As
you can see, the STRINGS syntax cleans up the main part of the .adm
template. It also allows for easy administration of all of the string
variables, because they are all located under the [STRINGS] section at
the bottom of the .adm template. If a string variable is used more than
once in the .adm template, you can just use the STRINGS syntax and the
string variable name at each instance, which will point to the single
instance of the actual string at the end of the .adm template. Within
the main body of the .adm template, the strings are referenced by using
the double exclamation point (!!) followed by the string variable name.
For
smaller .adm templates, you might not need to use the STRINGS syntax.
However, in larger .adm templates, the STRINGS syntax can help reduce
the complexity of the main body of the .adm template. The STRINGS
syntax is especially useful in conjunction with the EXPLAIN syntax. The
EXPLAIN text is generally very lengthy and can clog up the main body of
the .adm template. By using the STRINGS syntax within the main body of
the .adm template, you can leave the longer strings to the STRINGS
section at the bottom of the .adm template.
Tip
If
you need to convert .adm templates to different languages, you should
place all interface strings in the STRINGS section. You then need to
convert only the STRINGS section to the different languages. |
Note
The STRINGS syntax can be used with the CATEGORY, POLICY, PART, and EXPLAIN statements. |
4.2 CATEGORY
The
CATEGORY syntax produces the folders that you see in the GPME. Both the
Computer Configuration and User Configuration sections in the GPME
display these folders, so you use the CATEGORY syntax under both the
CLASS MACHINE and CLASS USER entries. The CATEGORY syntax can be nested
in a hierarchy, to generate subfolders. Each CATEGORY statement that
you list produces a folder or subfolder in the GPME.
The following structure creates three folders in a hierarchy.
CATEGORY "First level"
CATEGORY "Second level"
CATEGORY "Third level"
END CATEGORY
END CATEGORY
END CATEGORY
If
you want to display multiple policies under a single folder (CATEGORY
statement), you can just list the policies after the CATEGORY syntax
and before the END CATEGORY syntax.
Note
The
CATEGORY syntax must be combined with an END CATEGORY statement. This
is required so that the GPME knows where to stop nesting folders, as
well as where to stop placing policies within the folder. Additional syntax that you can use in conjunction with CATEGORY includes KEYNAME, CATEGORY, END, SUPPORTED, and POLICY. |