Generating HTML Reports for Group Policy Objects using PowerShell 2.0

Hi All,

There may be times that you want to generate an HTML report of your Group Policy Objects such as to review them, document them or show them to others. In order to gain access to the Group Policy Module containing the necessary cmdlets, you can install GPMC through the “Add Features Wizard” on a Windows 2008 R2 server. If you would like to gain access to the Group Policy Module from a Windows 7 machine, you can download and install the proper RSAT tools for Windows 7 and enable “Group Policy Management” under “Remote Server Administration Tools” in “Turn Windows Features on and off”.

To get started you will need to import the module by opening PowerShell and typing the following command:

Import-Module GroupPolicy

To Get a list of all GPOs in the Domain you can type the following:

Get-GPO -All

When I run this command I like to make the output easier to read by only selecting the display name of each GPO and sorting them in alphabetical order. To do that you can type the following:

Get-GPO -All | sort DisplayName | select Displayname

Now that I have obtained a list of GPOs Im going to choose one from the list and generate an HTML report for it. In the command below I am generating a report for a Group Policy named “Workstation Policy” and I am saving it to the root of the “c” drive.

Get-GPOReport -Name “Workstation Policy” -ReportType HTML -Path c:\WorkStationGPOReport.html

OK. Now lets say now you need to generate an HTML report for all GPOs in the domain. To do so, you can type the following command:

Get-GPOReport -All -ReportType HTML -Path c:\GPOAll.html

To learn more about generating GPO reports using the Get-GPOReport cmdlet you can use the help file by simply typing Get-Help Get-GPOReport. I hope this helps. If you have any questions or feedback please leave a comment.



Leave a Reply

Your email address will not be published. Required fields are marked *