Sometimes it's usefull to set a custum environment variable on a system (for example a XenApp silo server). You can use this variable in scripts and applications.
To flexibily set an environment variable at server startup you can use Windows Group Policy. In order to do this you need to create a custom ADM template.

This template looks something like this:

CLASS MACHINE

CATEGORY "Custom Settings"
CATEGORY "Systeem Variables"

       POLICY "Silo Variable"
             KEYNAME "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
                  PART "Silo" DROPDOWNLIST
                  VALUENAME "Silo"
                         ITEMLIST
                         NAME "Desktop"
                         VALUE "Desktop"
                         NAME "Apps"
                         VALUE "Apps"
                         NAME "Support"
                         VALUE "Support"
                         END ITEMLIST
                 END PART
            END POLICY ; Silo Variable

       POLICY "Application UNC Path"
            KEYNAME "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
            PART "UNC Path"
                 EDITTEXT
                 VALUENAME "APP_Path"
            END PART
       END POLICY ; Application UNC Path
  
END CATEGORY ; Systeem Variables
END CATEGORY ; "Custom Settings"

The first GPO settings contains a dropdownlist in which the value for the silo variable can be selected. The second setting just contains a text string in which a UNC path can be inserted.

In the Group Policy Management Console this looks like this:

    

Comments (0)