GPO: add a registry key


Windows Server 2019

Intro

In this tutorial, we will see how using a group policy, add a registry key.

With group policies, it is also possible to delete or modify the value of an existing key

Depending on the hive (HKLM / HKCU), the strategy should be placed on the correct OU (Organizational unit) and the correct computer or user configuration.

The registry settings are available in the Computer and User configuration.

In addition to placement, as I mentioned above, you must take into account the hive, if you want to apply a key to the hive (HK_CURRENT_USER) you must use the parameters of the user configuration.

It is possible to use the “hive” HK_CURRENT_USER \ .DEFAULT in the Computer configuration which allows you to apply the key for all new users who will log on to the computer, it is the equivalent of the default profile.

To illustrate the tutorial, the GPO which will be configured a key in the HKCU hive therefore on the user configuration.

Group Policy Configuration

From the Group Policy Management console, right-click on the location 1 where the group policy should apply and click on Create a GPO in this area, and link it here 2> >.

Nouvelle stratégie de groupe (GPO)

Name the group policy 1 and click OK 2.

Définir le nom de la stratégie de groupe

Right click on strategy 1 and click on Modify 2.

Modifier la stratégie de groupe

Go to the User Configuration / Preferences / Windows Settings / Registry 1 location.

Configuration utilisateur / Préférences / Paramètres Windows / Registre

Right click in the central area, go to New 1 then click on Register Element 2.

Créer un nouveau élément de registre

Configure the registry element by selecting the Action 1 then the hive 2. Indicate the path of the key 3 and the name of the key 4. Then choose the type of value 5 and enter the value 6. If necessary change the base according to the configuration of the key. Validate by clicking on Apply 7 and OK 8 to close the window.

Configuration de la clef

In the screenshot above, the RDGClientTransport key is created or updated with the value 1, in the HKEY_CURRENT_USER hive at the location Software \ Microsoft \ Terminal Server Client \

In the central area, the register element 1 has been added.

Clef ajoutée

Summary of group policy settings.

Paramètres de la stratégie

Validation of the operation of the GPO

On a computer and with a user to whom Group Policy applies, open a session and check the application in the computer’s registry with the presence of the key.




Leave a Comment