DESKTOP

Windows Server 2012 : Implementing Group Policy preferences (part 2) - Understanding preferences - Common options, Using environment variables

10/14/2014 9:19:52 PM

Common options

Several preference options are common to most types of preferences. These options can be configured using the Common tab on the properties sheet of the preference item. For example, Figure 3 shows the Common tab displayed when creating a new preference item of the Drive Maps preference type, which can be used to configure new mapped drives for users or computers targeted by a GPO. As you can see, one of the preference options on this tab is unavailable for configuration for this particular type of preference.

The Common tab on the properties sheet of a New Drive preference item.
Figure 3. The Common tab on the properties sheet of a New Drive preference item.

The different options available on the Common tab include

  • Stop Processing Items In This Extension If An Error Occurs A preference extension can contain one more preference items. If this option is selected, a preference item that fails to apply will prevent the remaining preference items in the extension from processing.

  • Run In Logged-on User’s Security Context (User Policy Option) By default, preferences are processed using the security context of the SYSTEM accounton the client. If this option is selected, the preference will be processed using the security context of the currently logged-on user on the client, which allows user-specific environment variables to be used in file system paths.

  • Remove This Item When It Is No Longer Applied By default, preference items are not removed from the client when the GPO targeting the user or computer goes out of scope. Selecting this option causes the preference item to be removed from the client when the GPO targeting the user or computer goes out of scope, which is done by deleting and then re-creating the preference item.

  • Apply Once And Do Not Reapply By default, preference items are rewritten whenever Group Policy is refreshed on the client. Selecting this option causes the preference item to be applied only once to the client.

  • Item-Level Targeting By default, a preference item configured in a GPO applies to all users and computers targeted by that GPO. Selecting this option allows you to change this behavior as described later in this lesson.

Using environment variables

Environment variables can be used in preference items to simplify the configuration of options such as file system paths. These variables can include

  • Standard Windows per-machine environment variables

  • Standard Windows per-user environment variables

  • Environment variables that are specific to Group Policy preferences

In addition, some variables might apply only to certain versions of Windows.

The following is a list of variables that can be processed by preference extensions:

  • %AppDataDir% The current user’s Application Data directory

  • %BinaryComputerSid% The security identifier (SID) of the computer in hexadecimal format

  • %BinaryUserSid% The SID of the current user in hexadecimal format

  • %CommonAppdataDir% The All Users Application Data directory

  • %CommonDesktopDir% The All Users Desktop directory

  • %CommonFavoritesDir% The All Users Explorer Favorites directory

  • %CommonProgramsDir% The All Users Programs directory

  • %CommonStartMenuDir% The All Users Start Menu directory

  • %CommonStartUpDir% The All Users Startup directory

  • %ComputerName% The NetBIOS name of the computer

  • %CurrentProcessId% The numeric identity of the main client process

  • %CurrentThreadId% The numeric identity of the main client thread

  • %DateTime% The current time (UTC)

  • %DateTimeEx% The current time (UTC) with milliseconds

  • %DesktopDir% The current user’s desktop directory

  • %DomainName% The domain name or workgroup of the computer

  • %FavoritesDir% The current user’s Explorer Favorites directory

  • %LastError% The last error code encountered during configuration

  • %LastErrorText% The last error code text description

  • %LdapComputerSid% The SID of the computer in Lightweight Directory Access Protocol (LDAP) escaped binary format

  • %LdapUserSid% The SID of the current user in LDAP escaped binary format

  • %LocalTime% The current local time

  • %LocalTimeEx% The current local time with milliseconds

  • %LogonDomain% The domain of the current user

  • %LogonServer% The domain controller that authenticated the current user

  • %LogonUser% The user name of the current user

  • %LogonUserSid% The SID of the current user

  • %MacAddress% The first detected media access control (MAC) address on the computer

  • %NetPlacesDir% The current user’s My Network Places directory

  • %OsVersion% The operating system, which can be a specific Windows operating system or Unknown

  • %ProgramFilesDir% The Windows Program Files directory

  • %ProgramsDir% The current user’s Programs directory

  • %RecentDocumentsDir% The current user’s Recent Documents directory

  • %ResultCode% The client’s exit code

  • %ResultText% The client’s exit code text description

  • %ReversedComputerSid% The SID of the computer in reversed-byte-order hexadecimal format

  • %ReversedUserSid% The SID of the current user in reversed-byte-order hexadecimal format

  • %SendToDir% The current user’s Send To directory

  • %StartMenuDir% The current user’s Start Menu directory

  • %StartUpDir% The current user’s Startup directory

  • %SystemDir% The Windows system directory

  • %SystemDrive% The name of the drive from which the operating system is running

  • %TempDir% The current user’s Temp directory as determined by Windows API

  • %TimeStamp% The time stamp of the configurations being implemented

  • %TraceFile% The path/name of the trace file

  • %WindowsDir% The Windows directory

To select a variable when configuring a preference item, do the following:

  1. Open the properties of the preference item, and click in any field when a variable can be used, such as the Location field on the General tab of a Drive Maps item.

  2. Press F3 to open the Select A Variable dialog box:

    image with no caption
  3. Select the variable you want to use in the field used for configuring the preference item.

  4. Deselect the Resolve Variable check box if you want the variable instead of the resolved value to appear in the properties of the preference item.

  5. Click Select to insert the variable in the preference item properties.

Other  
  •  Windows Server 2012 : Managing Group Policy using Windows PowerShell - Creating and linking GPOs
  •  Installing and Configuring Windows Server 2008 R2 : Installing Windows Server 2008 R2 (part 2) - Installing Windows Server 2008 R2—Server Core
  •  Installing and Configuring Windows Server 2008 R2 : Installing Windows Server 2008 R2 (part 1)
  •  Installing and Configuring Windows Server 2008 R2 : Preparing to install Windows Server 2008 R2
  •  Fast Response Monitors Group Test (Part 6) - Philips 242G5DJEB
  •  Fast Response Monitors Group Test (Part 5) - AOC E2461FWH
  •  Fast Response Monitors Group Test (Part 4) - BenQ GL2450
  •  Fast Response Monitors Group Test (Part 3) - Iiyama ProLite GB2773HS-6B1
  •  Fast Response Monitors Group Test (Part 2) - Asus VN247H
  •  Fast Response Monitors Group Test (Part 1) - Acer G276HLA
  •  
    Top 10
    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?
    Java Tutorials : Nested For Loop (part 2) - Program to create a Two-Dimensional Array
    Java Tutorials : Nested For Loop (part 1)
    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