Select Page

One of the cool features within Group Policy Preferences, is the ability to use environment variables instead of static values, within any number of policy areas. For example, you can use the Files GP Preferences area to copy files from one location to another. In that policy, you specify a source and destination for the file you want to copy. In either case–source or destination–you can GP Preferences environment variables so that you don’t have to specify a hard path. This is especially useful to accomodate systems that might have slightly different locations for a given destination. As an example, in the figure below, I’m copying a file from a server share to the temporary folder on the local client, and using the environment variable %TempDir% to specify the destination folder.

GPPEnv

This isn’t really anything special, but what is cool, is the breadth and variety of variables you have at your disposal in the GP editor. The question is, how do you find out about them? Well, that is the crux of this blog posting–a neat little trick for finding and inserting GPP environment variables. Within the GP editor dialog, with your cursor within a field you’re looking to fill out, simply press F3. When you do, a dialog similar to this will appear, showing you all possible values that you can insert into the editor:

Group Policy Preferences environment variable list

Group Policy Preferences environment variable list

You can simply select one of these variables and it will be inserted into your dialog and then get resolved when GP is processed by the computer or user. You will also note a little “resolve variables” checkbox in this picker dialog that comes up. Normally that is left checked if you want the variable you specify to be resolved by the client during GP processing, to it’s actual value. If for some reason, you don’t want that variable to get resolved, but rather to just remain a variable, you can un-check that box when you insert the variable. In that case, you’ll note some special angle brackets (<>) get added to the variable, which tells the GP Preferences client side extension not to resolve that variable at processing time. At the moment, I can’t think of any reason to use this feature, but I’m sure it’s been useful to someone in the past :-).

Hope that proves useful to folks!

Darren