Active Directory Script Highlight: Simple HTML Export of all Group Policy Object Details

So once you have cleaned up your group policies like I outlined in my last two Active Directory Scripts Highlights,  what’s next? In this article I have a couple of variations of  scripts using the Get-GPOReport cmdlet that will allow you to export all of your Group Policy settings into HTML pages, just like you would see from the Settings tab from within Group Policy Manager.

The first script exports all of your Group Policies into one big HTML page.

Get-GPOReport -All -ReportType Html -Path c:\temp\Domain_GPO_AllGPOsReport.htm

image

This will allow you to both have a record of all of your group policy settings, and it is also a quick way to produce a single searchable page for certain Group Policy settings within all of your Group Policies.

The second script exports your Group Policies into individual HTML files.  These are searchable from a folder level based on name or text inside each of the HTML files.

Get-GPO -all | % {Get-GPOReport -GUID $_.id -ReportType HTML -Path “C:\Temp\GPOOut\$($_.displayName).html”}

image

Note: Remember to Create your output path with the following command  first or your PowerShell script will error out. 

New-Item -ItemType Directory -Force -Path C:\Temp\GPOOut

Both of these scripts provide a way of capture your group policy setting from a point in time to document your environment or give you a professional output when providing documentation to those organization you are performing migrations for.

Do you have any GPO Documentation scripts?  Paste them in the Comments below.

Advertisement
This entry was posted in Active Directory, Group Policy, PowerShell and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s