You want to view the settings that have been defined on a GPO.
Open the GPMC snap-in.
In the left pane, expand the Forest container, expand the Domains container, browse to the domain of the target GPO, and expand the Group Policy Objects container.
Click on the target GPO.
In the right pane, click on the Settings tab.
Click the Show All link to display all configured settings.
> getreportsforgpo.wsf "<GPOName>" <ReportLocation> [/domain:<DomainDNSName>]
' This code generates a HTML report of all the properties ' and settings for a GPO. ' ------ SCRIPT CONFIGURATION ------ strGPO = "<GPOName>" ' e.g. Sales GPO strDomain = "<DomainDNSName>" ' e.g. rallencorp.com strReportFile = "<FileNameAndPath>" ' e.g. c:\gpo_report.html ' ------ END CONFIGURATION --------- set objGPM = CreateObject("GPMgmt.GPM") set objGPMConstants = objGPM.GetConstants( ) ' Initialize the Domain object set objGPMDomain = objGPM.GetDomain(strDomain, "", objGPMConstants.UseAnyDC) set objGPMSearchCriteria = objGPM.CreateSearchCriteria objGPMSearchCriteria.Add objGPMConstants.SearchPropertyGPODisplayName, _ objGPMConstants.SearchOpEquals, cstr(strGPO) set objGPOList = objGPMDomain.SearchGPOs(objGPMSearchCriteria) if objGPOList.Count = 0 then WScript.Echo "Did not find GPO: " & strGPO WScript.Echo "Exiting." WScript.Quit elseif objGPOList.Count > 1 then WScript.Echo "Found more than one matching GPO. Count: " & _ objGPOList.Count WScript.Echo "Exiting." WScript.Quit else WScript.Echo "Found GPO: " & objGPOList.Item(1).DisplayName end if set objGPMResult = objGPOList.Item(1).GenerateReportToFile( _ objGPMConstants.ReportHTML, _ strReportFile) ' This will throw an exception if there were any errors ' during the actual operation. on error resume next objGPMResult.OverallStatus( ) if objGPMResult.Status.Count > 0 then WScript.Echo "Status message(s): " & objGPMResult.Status.Count for i = 1 to objGPMResult.Status.Count WScript.Echo objGPMResult.Status.Item(i).Message next WScript.Echo vbCrLf end if ' Display the result if Err.Number <> 0 then WScript.Echo "Error generating report." WScript.Echo "Error: " & Err.Description else WScript.Echo "Reported saved to " & strReportFile end if
The GPMC can generate an XML or HTML report that contains all of the settings in a GPO. See Recipe 9.6 for more on how to modify GPO settings.
I use a GPMSearchCriteria object to find the GPO that is equal to the display name of the GPO specified in the configuration section. I use an if elseif else conditional statement to ensure that only one GPO is returned. If zero or more than one are returned, I abort the script. If only one is returned, I used the GPMGPO.GenerateReportToFile method to generate a report of all the settings in the GPO. The first parameter for GenerateReportToFile is a constant that determines the type of report to generate (i.e., HTML or XML). The second parameter is the path of the file to store the report.
MSDN: GPMGPO.GenerateReportToFile