Gruppenrichtlinien erleichtern einem Admin das Leben und lassen sich mit wenig Aufwand selbst erstellen. Der Vorteil liegt auf der Hand, mittels Gruppenrichtlinien lassen sich Registry Einstellungen einfach auf viele Rechner verteilen. Im folgenden Artikel gibt es ein kleines HowTo, wie Gruppenrichtlinien mit dem kostenlosen „Old-School“-Tool „ADMX-Migrator“ selbst erstellt werden können.
Foreword
I have also created a few separate group policies for Exchange Server and Domain Controller, as a few settings are also made here via the registry. Here are a few examples of settings in the registry that can be easily configured via GPO:
The advantage of a group policy for such settings? Once an appropriate template has been created for the settings in the registry, a group policy can be applied in different environments on several servers. New domain controllers or new Exchange servers automatically receive the same settings as the existing ones.
The classic ADM templates from Windows Server 2003 times (and earlier) could be created with little effort. Here is a small example:
ADM was still pretty self-explanatory. The current format (ADMX) is based on an XML structure. ADMX templates are a lot more flexible, but also a bit more complicated if you want to create them with a simple editor. Here is an example of an ADMX template with a language:
Admittedly, the example for the ADMX template comes from a GUI and is not a manually created template, but you can see at first glance that the XML structure is more complex to create manually.
This can be remedied by a small tool that can be downloaded free of charge:
ADMX Migrator is an old tool that is no longer being developed. But I still like to use it, simply out of habit:
If anyone has a good tip for a current tool, I'd be happy to hear about it in the comments.
Installation
The installation of ADMX-Migrator is self-explanatory and can be completed in just a few clicks, so here are a few screenshots for the sake of completeness:
Enter user information:
Select storage location:
Die Option „Register after Insallation is complete“ kann abgewählt werden, die entsprechende Internetseite gibt es nicht mehr:
Installation completed.
Create your own group policies (ADMX templates)
Um eine Gruppenrichtlinie für ein bestimmtes Programm zu erstellen, muss zuerst rausgefunden werden, wo das Programm seine Einstellungen in der Registry speichert, welche Einstellungen gültig sind und was sie bewirken. Dazu muss das Programm auf einem Testrechner installiert werden und entsprechende Einstellungen in der Registry gesucht werden. Dieser Teil dauert üblicherweise am längsten, da hier häufig „Trial and Error“ angesagt ist. Damit man schnell wieder auf die Standard Einstellungen zurückgreifen kann, ist es hilfreich die entsprechenden Schlüssel zu exportieren. So lässt sich der Standard schnell wiederherstellen.
As an example, I have taken a fictitious program that stores settings under HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE:
As soon as it has been determined which settings are relevant, a group policy can be created using ADMX Migrator:
The new template is now given a name:
Jetzt kann die erste Kategorie angegeben werden, die erste Kategorie unterhalb des Namens, erstellt einen „Ordner“ unter „Administrative Vorlagen“. Auch der Name der Kategorie kann frei gewählt werden, ich nehme in diesem Fall „FW Programm“, damit erkenntlich ist, um welche Einstellungen es sich handelt:
Further categories can be created below the first category. I create a category for users and computer settings:
In the Group Policy Editor, the categories will later be displayed like this:
Die grobe Struktur steht also schon einmal, jetzt kommen die Einstellungen dran. In diesem Fall möchte in den Wert für „UseWindowsDefault“ steuern, also wird auch hier der Schlüsselname und der Name des entsprechendes Werts kopiert:
Die Angaben werden nun für die erste „Policy Setting“ benötigt. Da es sich um eine Einstellung unter HKEY_CURRENT_USER handelt, kommt sie in die Kategorie „Benutzer“. In der Policy Setting werden nun die entsprechenden Werte eingesetzt:
Registry Key: Key name
Registry Value Name: UseWindowsDefault
Class: User (because HKEY_CURRENT_USER)
The values are now defined under the Values setting:
Enabled Value = Enabled = 1
Disabled Value = Disabled = 0
Under Explain, a meaningful description can now be added to the setting:
It now looks like this in the Group Policy Editor:
ADMX-Migrator can be used not only to switch DWORDs, but also to create text fields or drop-down lists. In principle, the procedure here is very similar to that for DWORDS. In the next example there are two REG_SZ values:
As these are located under HKEY_CURRENT_USER, the policy settings are also placed under the User category:
Enabled and disabled values are also specified again:
A drop-down list can now be created under Presentation:
Corresponding key names and key values are again specified for the drop-down list, and the settings for the drop-down list can then be added under ItemList:
All values from the drop-down list and the corresponding values are now entered in the item list:
A description is given again under Explain:
Here is the result in the Group Policy Editor:
As soon as the group policy has been configured, it is saved:
The memory path now contains the ADMX file (contains the settings) and a folder with the respective language file:
To use your own group policy, the ADMX file and the folder on a domain controller must be copied to the directory c:\Windows\PolicyDefinitions:
Converting ADM to ADMX templates
ADMX-Migrator kann auch alte ADM Templates zu ADMX Templates umwandeln, dazu kann über den Punkt „Generate ADMX from ADM“ ein ADM Template geladen werden:
ADMX Migrator then converts the old ADM structure into the ADMX XML structure:
After conversion to ADMX format, options can be adapted or changed:
As soon as editing is complete, the ADMX template can be saved:
When saving, ADMX-Migrator creates the structure that is also required by the Windows Central Store:
In this way, old ADM templates can be easily converted to ADMX templates.
Note: Mit Umlauten in den ADM-Templates kommt ADMX-Migrator nicht zurecht, am einfachsten ist es also vor der Konvertierung die Umlaute in den ADM Templates mittels „Suchen/Ersetzen“ loszuwerden.
Example ADMX files
As already mentioned at the beginning, ADMX-Migrator is a fairly old tool and has some weaknesses; it sometimes crashes.
However, a group policy only consists of the ADMX file which contains the settings (categories, policy settings) and a language file (ADML), in which corresponding translations can be defined. Both files are available in XML format and can also be created with an editor.
Microsoft bietet eine Gruppenrichtlinie als Beispiel an, in der die Möglichkeiten verdeutlich werden. Mit ein bisschen Copy/Paste und etwas „Try and Error“, lässt sich die Struktur schnell erlernen.
The sample files can be downloaded here:
Group Policy Sample ADMX Files
A test environment with a domain controller and a member is quickly installed, so the sample policy is great for practicing.
Disadvantage
Eigene Gruppenrichtlinien „tätowieren“ die Registry. Soll heißen, die Registry Werte die mittels eigener Gruppenrichtlinie geändert oder erzeugt wurden, bleiben in der Registry des Computers vorhanden der die Richtlinie angewendet hat. Wenn eine Gruppenrichtlinie gelöscht wird, bleiben die Einstellungen also bestehen. Der Einsatz von eigenen Gruppenrichtlinien ist also mit Vorsicht zu genießen.
Always remember: Deleting your own group policy does not reset any settings to default values, only defining the default values in the GPO sets the corresponding values. If you still know the default values. Own group policies should therefore be well documented and the default values of the registry should be exported in a .REG file.