Registry Actions
Registry manipulation enables registry keys and values to be setup for the user for the delivered application set. Most applications require some form of default configuration to be present in order for correct operation.
Registry Key actions allow registry keys to be created or deleted and enable registry key values to be set, created and deleted.
Importing a registry file enables an area of the registry of a local or remote endpoint to be added to the registry of managed endpoints. This enables multiple registry keys and values to be created and deleted without having to create each action individually.
Additionally, it is possible to import desired state settings from an existing machine or exported registry file or even manipulate registry settings using registry hiving.
In this section:
- Create Registry Actions
- Import a Registry File
- Create a User Logoff Registry Hive Action
- Create a User Logon Registry Hive Action
- Registry Key Manipulation
- Registry Hiving
- Merge and Replace Restore Formats
Create Registry Actions
- In the Policy Configuration navigation tree, create a new node or select an existing node.
- In the Actions ribbon,
select Registry and choose the
required option:
- Create Key - Configure a list of registry keys which will be created on managed endpoints when triggers and conditions apply. Keys are identified by selecting the relevant hive and browsing to or entering the key.
- Delete Key - Configure a list of registry keys to delete on managed endpoints.
- Set Value - Identify a registry key and enter a value which will be set for that key.
- Delete Value - Delete the value entered for the selected key on managed endpoints.
- Set Default Value - Identify a registry key and enter a value which will be set as the default value for that key.
- Click Add.
- Complete the fields
as required. Each of these conditions uses as combination of the following
fields:
- Hive - Select the hive containing the registry key.
- Key - Enter or browse to the key within the registry.
- Value Name - Enter or browse to the required value for the key.
- Click OK
to create the action.
See also Configuring Actions in the Action Management help. - Keys and values can be removed from the dialog boxes by selecting and clicking Remove.
The Create Registry Key and Delete Registry Key actions only include the Hive and Key fields.
Registry Value Actions
The Registry Value actions use the same fields as the Set Default Value dialog box above.
Import a Registry File
- In the Policy Configuration navigation tree, create a new node or select an existing node.
- In the Actions ribbon, select Registry > Import a Registry File to display the Registry Import dialog.
- Select the required
option:
- Import File - Add the registry keys and values from a registry file exported from an endpoint using Regedit or other registry tool.
Browse - Examine the registry of the local or a remote endpoint to select an area of the registry to be imported into managed endpoints when triggered.
Keys and sub keys are displayed on the left side of the dialog box and any values for a selected key are displayed on the right.
- Select the Delete checkbox for all those keys, sub keys and values you wish to delete on managed endpoints. Those not selected will be created and have values and default values set.
- Click OK.
Actions are created for each create, delete and set value defined in the registry import.
Create a User Logoff Registry Hive Action
- In the Policy Configuration navigation tree, create a new node in the User > Logoff trigger.
- Rename the node to Export Registry Settings or similar.
- In the Actions ribbon, select Registry > Registry Hiving to display the Registry Hiving dialog.
- Enter a Title for example, Save User Profile Settings.
-
Enter or browse to the location where the settings will be saved, preferably on a network share so that settings can be accessed from multiple computers. It is not necessary to create separate folders for each user as Environment Manager will separate the user information being saved using the following format:
<registry key name>.<domain>_<username>
- Select Export the hive from the registry to file.
- Click Add. The Registry Key dialog box displays.
- Enter the key or select the ellipsis in the Key box to display the Browse Registry dialog box.
- Select the areas of the HKCU registry you want to hive out. This can be from the local computer registry or a registry on another machine.
- Enter the Value
for the key and select the required options:
- Use default value name - Use the default value name from the registry for the key. If selected and the value does not contain any data, the hive will fail.
- Restore Format:
- Replace - Exports as a binary file which replaces any existing values or sub-keys on import.
- Merge - Exports as a Microsoft Regedit 5 file which merges with any existing values or sub-keys on import.
- Override File Name - Deselect Use registry key as file name to edit the default file path in the File Name field set when selecting the key.
- Click OK to add the registry key to the Registry Hiving dialog box.
- Repeat the Add process for each registry key you want to hive out.
- Click OK to save the action.
Once you have created the registry hive actions that will apply at logoff, you must configure Environment Manager to import these registry settings when the user next logs on.
Create a User Logon Registry Hive Action
- Prior to using this procedure, you first need to create the registry hive actions that will apply at logoff. Use the link below to access that procedure.
- In the Policy Configuration navigation tree, create a new node in the User > Logoff node.
- Rename the node Import Registry Settings or similar.
- In the Actions ribbon, select Registry > Registry Hiving to display the Registry Hiving dialog.
- Navigate back to User > Logoff >Export Registry Settings node created earlier.
- Right-click on the Save User Profile Settings action and select Copy.
- Navigate back to User > Logon >Import Registry Settings node.
- Right-click in the Actions list in the Node work area and select Paste.
- Double-click the Hive Registry action that has just been copied. The Registry Hiving dialog box displays.
- Rename the title to Load User Profile Settings.
- Select Import the hive from file to the registry and click OK.
The action is saved and renamed.
Registry Key Manipulation
Registry settings can be used to personalize applications and Windows Settings. This can be done in Policy Configuration and User Personalization. However, it is recommended you only use Policy Configuration or User Personalization to manage personalization to ensure optimum performance.
The Windows registry is divided into five separate keys:
- HKEY_CLASSES_ROOT - Contains information relating to file associations and for object linking and embedding.
- HKEY_CURRENT_USER - Contains the profile settings for the current user.
- HKEY_LOCAL_MACHINE - Contains configuration settings for the computer itself.
- HKEY_USERS - Contains all the actively loaded user profiles on the computer.
- HKEY_CURRENT_CONFIG - Contains settings related to installed software and device drivers.
Whenever a user makes any changes to their personal settings, the information is stored in the HKEY_CURRENT_USER (HKCU) hive area of the registry. Therefore, if the registry settings are saved out when the user logs off and re-imported the next time the user logs on, the user's personal settings are available to roam with them, even if they are using a mandatory profile.
This is achieved using the Registry Hiving action within Environment Manager.
Registry Hiving
Whenever a user makes any changes to their personal settings, the information is stored in the HKEY_CURRENT_USER (HKCU) hive area of the registry. Therefore, if the registry settings are saved out when the user logs off and re-imported the next time the user logs on, the user’s personal settings are available to roam with them, even if they are using a mandatory profile.
This is achieved using the Registry Hiving action within Environment Manager.
This section describes how to create a User Logoff Registry Action and a User Logon Registry Action to hive out and back in user profile settings.
You first need to create the registry hive actions that will apply at logoff, and then you need to configure Environment Manager to import these registry settings when the user next logs on.
Merge and Replace Restore Formats
Registry hives can be exported in one of two formats using the Registry Hive action: Replace or Merge. It is important to select the right format for each key as some keys may not be suitable for a particular format due to the different behavior of the formats.
The Replace format is a binary file whereas an export in Merge format produces a text file in the Microsoft Regedit 5 format. Both contain the data for the exported registry key, all sub-keys and values.
When importing a binary file exported in Replace mode, the entire key is replaced with the contents of the file. As a result, any values or sub-keys which have been added since the export, are deleted.
When a Merge mode text file is imported, only the keys and values present in the export are applied to the registry. As a result, any values or sub-keys which have been added since the export, will still be present in the registry following the import.
Registry values, if individually selected, are always exported as a text file regardless of the mode.
HKCU\Software\AppSense is exported in Replace mode.
Sub-key HKCU\Software\AppSense\Settings is added after the export.
On import, the sub-key is deleted.
HKCU\Software\AppSense is exported in Merge mode.
Sub-key HKCU\Software\AppSense\Settings is added after the export.
On import, the sub-key is not deleted.