The other day I had to finish off the documentation for a XenApp 6.5 Implementation I did a couple of months back for one of our customers. Of course group policies are a configuration item, I wanted to have in that document.
What I did not want was the default format that the Group Policy Management Console offers in its HTML Reports of GPO settings.
What else could I do?
Of course there is the option to create an XML export with the Group policy module imported into PowerShell.
The problem is, the output can’t be parsed generically, instead parsing has to be done individually for each type of Settings.
The first step is to export all GPOs to xml files and copy them somewhere I have access to without the need of being a Domain Admin.
The content of $xml is the base for an XPath query searching for the Node “Extension”.
Next step is to read the type of the GPO (f.e: RegistrySettings, FolderRedirectionSettings, SecuritySettings, DriveMapSettings …)
To convert the actual settings of a random type into something that is easy to read, each of those types must be inspected in order to develop a mini parser for it. Two simple examples are “Registry Settings” and “Internet Explorer Settings”
Type = RegistrySettings
Type = InternetExplorerSettings
An example for a more complicated structure is “Securitysettings”
After I have determined “Type” (and if necessary “Name”) of each node,
I run a switch Loop and call a function depending on “Type” (I have already finished the below types, there are heaps more).
The Output looks like the following:
U_XenApp_General_Settings is linked to: domain-fqdn/Servers/Citrix
GPO Type InternetExplorerSettings
Empower HR System http://go/ess
GPO Type RegistrySettings
action : R
displayDecimal : 0
default : 0
hive : HKEY_CURRENT_USER
key : Software\Microsoft\Communicator
name : AutoRunWhenLogonToWindows
type : REG_DWORD
value : 00000000
GPO Typ RegistrySettings
Intranet Sites: Include all sites that bypass the proxy server Enabled
Intranet Zone Template Enabled
Site to Zone Assignment List Enabled