Get-GPOReport

Generates a report either in XML or HTML format for a specified GPO or for all GPOs in a domain.

Syntax

Get-GPOReport [-Guid] [-ReportType] [[-Path] ] [[-Domain] ] [[-Server] ] []
Get-GPOReport [-Name] [-ReportType] [[-Path] ] [[-Domain] ] [[-Server] ] []
Get-GPOReport [-ReportType] [[-Path] ] [[-Domain] ] [[-Server] ] [-All] []

Description

The Get-GPOReport cmdlet generates a report in either XML or HTML format that describes properties and policy settings for a specified Group Policy Object (GPO) or for all GPOs in a domain. The information that is reported for each GPO includes: details, links, security filtering, Windows Management Instrumentation (WMI) filtering, delegation, and computer and user configurations.

You can specify the All parameter to generate a report for every GPO in the domain, or you can specify either the Name or Guid parameter to generate a report for a single GPO. You can also pipe GPO objects into this cmdlet. If you specify a file through the Path parameter, the report is written to a file; otherwise, it is printed to the display.

Examples

Example 1: Generate an HTML report for the specified GPO

Get-GPOReport -Name "TestGPO1" -ReportType HTML -Path "C:\GPOReports\GPOReport1.html"

This command generates a report in HTML format for the GPO TestGPO1 and writes it to the file C:\GPOReports\GPOReport1.html

Example 2: Generate an XML report for each GPO in the specified domain

$params = @ < All = $true Domain = 'sales.contoso.com' Server = 'DC1' ReportType = 'XML' Path = 'C:\GPOReports\GPOReportsAll.xml' >Get-GPOReport @params

This command generates a report in XML format for each GPO in the sales.contoso.com domain and writes it to the file C:\GPOReports\GPOReportsAll.xml . The DC1 domain controller is contacted to complete the operation.

If the domain of the user account (or, for startup and shutdown scripts, the computer account) is different from sales.contoso2.com , a trust must exist between the two domains.

Example 3: Generate an XML report for a GPO with the specified GUID

Get-GPOReport -GUID 73624cc9-e8f2-4f05-8802-193fae8773ce -ReportType XML

This command generates a report in XML format for the GPO with the specified GUID. Because no Path parameter is supplied, the report is written to the display.

Parameters

-All

Indicates that the cmdlet generates a report for all GPOs in the domain.

Type:SwitchParameter
Position:5
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Domain

Specifies the domain for this cmdlet. You must specify the fully qualified domain name (FQDN) of the domain.

For the Get-GPOReport cmdlet:

If you do not specify the Domain parameter, the domain of the user that is running the current session is used. If the cmdlet is being run from a computer startup or shutdown script, the domain of the computer is used. For more information, see the Notes section in the full Help.

If you specify a domain that is different from the domain of the user that is running the current session or, (for a startup or shutdown script, the computer), a trust must exist between that domain and the domain of the user or the computer.

You can also refer to Domain by its built-in alias, DomainName. For more information, see about_Aliases.

Type:String
Aliases:DomainName
Position:3
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Guid

Specifies the GPO for which to generate the report by its globally unique identifier (GUID). The GUID uniquely identifies the GPO.

You can also refer to the Guid parameter by its built-in alias, Id. For more information, see about_Aliases

Type: Guid
Aliases:Id
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the GPO for which to generate the report by its display name.

The display name is not guaranteed to be unique in the domain. If another GPO with the same display name exists in the domain an error occurs. You can use the Guid parameter to uniquely identify a GPO.

You can also refer to the Name parameter by its built-in alias, DisplayName. For more information, see about_Aliases.

Type:String
Aliases:DisplayName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Path

Specifies the path to the report file; for instance, c:\Reports\GpoReport.xml . If no path is specified, the report is printed to the display.

Type:String
Position:2
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReportType

Specifies the format of the report. You must specify either Html (for HTML format) or Xml (for XML format). These values are not case sensitive.

The following values are permitted for this object type.

Type: ReportType
Accepted values:Xml, Html
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Server

Specifies the name of the domain controller that this cmdlet contacts to complete the operation. You can specify either the fully qualified domain name (FQDN) or the host name.

If you do not specify the name by using the Server parameter, the primary domain controller (PDC) emulator is contacted.

You can refer to this parameter by its built-in alias, DC. For more information, see about_Aliases.

Type:String
Aliases:DC
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.GroupPolicy.Gpo

An object that represents a GPO. Collections that contain GPOs from different domains are not supported.

Outputs

None

This cmdlet does not generate any output.

Notes