DESKTOP

Windows Server 2008 and Windows Vista : Using .adm Template Language (part 7)

12/4/2013 2:59:35 AM
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.

Figure 5. The LISTBOX syntax provides an interface in which multiple values can be entered for a single registry value.


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
VariantDescription
ACTIONLISTONSpecifies an optional action list to be used if the check box is selected.
ACTIONLISTOFFSpecifies an optional action list to be used if the check box is not selected.
Other  
  •  Windows Server 2008 and Windows Vista : Creating Custom .adm Templates - A Simple .adm Template
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 5) - Optional Tasks for Implementing Software Restriction Policies
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 4) - Implementing Software Restriction Policies - Creating a Path Rule, Designating File Types
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 3) - Implementing Software Restriction Policies - Creating a Certificate Rule, Creating an Internet Zone Rule
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 2) - Implementing Software Restriction Policies - Creating a Hash Rule
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 1)
  •  Windows Server 2003 : Troubleshooting Software Deployed with Group Policy - Software Deployment Troubleshooting Scenarios
  •  Windows Server 2003 : Maintaining Software Deployed with Group Policy (part 2) - Removing Applications Deployed with Group Policy
  •  Windows Server 2003 : Maintaining Software Deployed with Group Policy (part 1) - Upgrading Applications Deployed with Group Policy
  •  Windows 7 : Using WDS for Multicast Deployments (part 2) - Creating a Multicast Deployment
  •  
    Top 10
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    3 Tips for Maintaining Your Cell Phone Battery (part 1) - Charge Smart
    OPEL MERIVA : Making a grand entrance
    FORD MONDEO 2.0 ECOBOOST : Modern Mondeo
    BMW 650i COUPE : Sexy retooling of BMW's 6-series
    BMW 120d; M135i - Finely tuned
    PHP Tutorials : Storing Images in MySQL with PHP (part 2) - Creating the HTML, Inserting the Image into MySQL
    PHP Tutorials : Storing Images in MySQL with PHP (part 1) - Why store binary files in MySQL using PHP?
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS