To create a correctly formatted Registry GPP, follow the below guidelines.
Computer Registry GPP
$XMLItemAttributes = ("collection","coldisabled","clsid","name","status","image","changed","uid","disabled","bypassErrors","desc","removePolicy","PRIMARYEND","action","displayDecimal","default","hive","key","name","type","value","RUNONCE","SUBEND")
User Registry GPP
$XMLItemAttributes = ("collection","coldisabled","clsid","name","status","image","changed","uid","disabled","bypassErrors","userContext","desc","removePolicy","PRIMARYEND","action","displayDecimal","default","hive","key","name","type","value","RUNONCE","SUBEND")
$XMLItemAttributes values
collection - This is the name of the collection the preference will belong to.
coldisabled - This determines if the collection is disabled or enabled by default.
clsid - This is the clsid of the GPP registry item. GPP clsid Reference
name - Name of the GPP item.
status - A field that is updated when the value of the GPP is updated. Can be the same text as name or value.
image - This is the image that is shown in the Group Policy GUI. Image Reference
changed - Date the GPP is set. $DateUni = (Get-Date -Format u).TrimEnd('Z').
uid - Generate GUID. $GUID = ([guid]::NewGuid()).ToString().ToUpper().
disabled - Enabled
or Disabled
. Icon color is indicating the action taken when pressed. On an enabled GPP it is red and on a disabled GPP is green.
bypassErrors - Sets the Stop processing items in this extension is an error occurs. Value of 1 is unchecked, value of 0 is checked.
userContext Sets the Run in logged-on user's security context (user policy option). Value of 1 is checked, value of 0 is unchecked. Only used in User Registry GPP.
desc Set's the Description text. By default includes the $FirmName and $Date. Useful to add additional notes about what the setting actually controls.
removePolicy - Sets the Remove this item when it is no longer applied. Value of 1 is checked, value of 0 is unchecked. Only works with Replace action.
PRIMARYEND - Internal script header to indicate XML subnode.


action - Identifies the action for the GPP.
| Action | Value |
|---|---|
| Create | C |
| Replace | R |
| Update | U |
| Delete | D |
displayDecimal - If set to 1 it will display a numeric value as a decimal number.
default - Checks the default box t create the (Default) registry key. Value of 1 is checked, value of 0 is unchecked.
hive - Should be set to the appropriate hive, in a computer case, HKEY_LOCAL_MACHINE. In a user case, HKEY_CURRENT_USER. The only other value that might be used frequently in a machine case is HKEY_CLASSES_ROOT, though the GUI allows the selection of other hives.
key - The registry key that is being set. Usually starts with SOFTWARE\, but could be any other registry key.
name - The registry value that is being set.
type - The appropriate registry value type: REG_SZ, REG_DWORD, REG_BINARY, REG_MULTI_SZ, REG_EXPAND_SZ, or REG_QWORD
value - Value for the specific registry key. In the case of REG_DWORD should be put in hexadecimal format: 00000000 or 00000001.
RUNONCE - Signifies if the GPP should be set to Apply once and do not reapply. Valid values are YES or NO.
SUBEND - Internal script header to indicate XML subnode ending.
Registry GPP Example
See Deployment for instructions on updating GPP.
$XMLItemValues += @("Windows","0",$RegistryCLSID,"Explorer - Expand Taskbar Icons","Explorer - Expand Taskbar Icons","12",$DateUni,$GUID,"0","1","0","Created By $FirmName on $Date for Windows. Expands the Taskbar Icons.","0","PRIMARYEND","U","0","0","HKEY_CURRENT_USER","Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced","TaskbarGlomLevel","REG_DWORD","00000001","Yes","SUBEND")
In this example, the GPP is going to be added to the Windows collection and un-group like icons in the Taskbar.
