4.4.6 LISTBOX
The
LISTBOX PART component specifies various options such as drop-down list
boxes, text boxes, and text in the lower pane of the GPME. The LISTBOX
is a simple syntax, as you can see from this snippet from the
System.adm template:
PART !!RestrictAppsList LISTBOX
KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\RestrictRun"
VALUEPREFIX ""
END PART
The resulting GPME interface is shown in Figure 5.
In
addition to the standard LISTBOX syntax, you can also add more options
to the administrative template, including the following:
ADDITIVE
By default, the content of list boxes overrides any values set in the
target registry. This means that a control value is inserted in the
policy file that causes existing values to be deleted before the values
set in the policy file are merged. If this option is specified,
existing values are not deleted and the values set in the list box are
in addition to whatever values exist in the target registry. If a GPO
that uses this syntax is disabled, the disabled settings are not
applied and are thus removed from the registry.
Caution
The
ability to disable a GPO using the LISTBOX ADDITIVE syntax was
introduced with Windows XP Professional SP2. If you attempt to
administer a GPO that uses the new LISTBOX ADDITIVE syntax on a
computer that does not run Windows XP Professional SP2 or Windows
Server 2003 SP1, you will receive an error: “The following entry in the
[strings] section is too long and has been truncated.” To obtain
hotfixes to correct this problem on different platforms, see article
842933 in the Microsoft Knowledge Base at http://support.microsoft.com/kb/842933. |
EXPLICITVALUE
This option requires the user to specify the value data and the value
name. The list box shows two columns, one for the name and one for the
data. This option cannot be used with the VALUEPREFIX option.
VALUEPREFIX prefix
The prefix you specify is used in determining value names. If you
specify a prefix, the prefix and an incremented integer are used
instead of the default value naming scheme described previously. For
example, a prefix of SampleName generates the value names SampleName1, SampleName2, and so on. The prefix can be empty (“”), which causes the value names to be 1, 2, and so on.
Note
Additional
syntax that you can use in conjunction with LISTBOX includes KEYNAME,
VALUEPREFIX, END, ADDITIVE, EXPLICITVALUE, EXPANDABLETEXT, NOSORT, and
CLIENTEXT. |
4.4.7 NUMERIC
Displays
an edit field with an optional spin box control (an up-down control)
that accepts a numeric value. It is best to use the MIN and MAX syntax
in conjunction with the NUMERIC syntax to ensure that the registry does
not become corrupted with invalid data. The following is a snippet from
the System.adm template using the NUMERIC syntax:
PART !!ProfileSize
NUMERIC REQUIRED SPIN 100
VALUENAME "MaxProfileSize"
DEFAULT 30000
MAX 30000
MIN 300
END PART
The
SPIN syntax allows for a spin box control to set the range of values
that can be set. This adds to the MIN and MAX controls to provide a
boundary for the data of the registry value. Other syntax that you can
use along with the NUMERIC syntax includes:
DEFAULT value Specifies the initial numeric value for the edit field. If this option is not specified, the field is initially empty.
MAX value Specifies the maximum value for the number. The default value is 9999.
MIN value Specifies the minimum value for the number. The default value is 0.
REQUIRED
Specifies that the GPME does not allow a policy containing this PART to
be enabled unless a value has been entered for this PART.
SPIN value Specifies increments to use for the spin box control. The default is SPIN 1.
SPIN 0 Removes the SPIN control from the “policy” settings.
TXTCONVERT Writes values as REG_SZ strings (“1”, “2”, or “128”) rather than as binary values.
Note
Additional
syntax that you can use in conjunction with NUMERIC includes KEYNAME,
VALUENAME, END, MIN, MAX, SPIN, TXTCONVERT, REQUIRED, DEFAULT, and
CLIENTEXT. |
4.4.8 TEXT
The
TEXT syntax can be used to display text on the property page of a
policy setting. The following is a snippet from the System.adm template
that uses the TEXT syntax:
PART !!GPRefreshRate_C_Desc1 TEXT
END PART
PART !!GPRefreshRate_C_Desc2 TEXT
END PART
This creates two lines of static text in the dialog box when you edit the policy setting.
4.5 ACTIONLIST
You
can use the ACTIONLIST syntax to specify a set of arbitrary registry
changes to make in response to a control being set to a particular
state. Here is a snippet of code for the ACTIONLIST syntax:
POLICY "Deny connections requests"
EXPLAIN "If enabled, TS will stop accepting connections"
ACTIONLISTON
VALUENAME "fDenyTSConnections" VALUE NUMERIC 1
END ACTIONLISTON
ACTIONLISTOFF
VALUENAME "fDenyTSConnections" VALUE NUMERIC 0
END ACTIONLISTOFF
END POLICY
ACTIONLIST has two variants that you can use with the POLICY and CHECKBOX syntax. Table 2 describes these variants.
Table 2. CHECKBOX Syntax Variants
Variant | Description |
---|
ACTIONLISTON | Specifies an optional action list to be used if the check box is selected. |
ACTIONLISTOFF | Specifies an optional action list to be used if the check box is not selected. |