October 18

Windows: gpresult

 

Starting with Vista SP1, RSoP no longer shows all of the group policies that a computer might have being applied to it. Instead, Microsoft recommends that you use the command line tool GPResult.

Just open the Command Prompt and type:

gpresult

Being a command line tool, it opens up the possibilities to include it in scripting. There are a large number of options you can use with GPResult to get exactly what you want. You can use it to create a nicely formatted HTML or XML report and you can also use it to run remotely on another system and as a different user (provided you know the password).

 

GPRESULT [/S system [/U username [/P [password]]]] [/SCOPE scope]
[/USER targetusername] [/R | /V | /Z] [(/X | /H) <filename> [/F]]

Description:
This command line tool displays the Resultant Set of Policy (RSoP)
information for a target user and computer.

Parameter List:
/S        system           Specifies the remote system to connect to.

/U        [domain]user    Specifies the user context under which the
command should execute.
Can not be used with /X, /H.

/P        [password]       Specifies the password for the given user
context. Prompts for input if omitted.
Can not be used with /X, /H.

/SCOPE    scope            Specifies whether the user or the
computer settings needs to be displayed.
Valid values: “USER”, “COMPUTER”.

/USER     [domain]user    Specifies the user name for which the
RSOP data is to be displayed.

/X        <filename>       Saves the report in XML format at the
location and with the file name specified
by the <filename> parameter. (valid in
Windows Vista SP1 and Windows Server 2008)

/H        <filename>       Saves the report in HTML format at the
location and with the file name specified by
the <filename> parameter. (valid in Windows
Vista SP1 and Windows Server 2008)

/F                         Forces gpresult to overwrite the file name
specified in the /X or /H command.

/R                         Displays RSoP summary data.

/V                         Specifies that verbose information should
be displayed. Verbose information provides
additional detailed settings that have
been applied with a precedence of 1.

/Z                         Specifies that the super-verbose
information should be displayed. Super-
verbose information provides additional
detailed settings that have been applied
with a precedence of 1 and higher. This
allows you to see if a setting was set in
multiple places. See the Group Policy
online help topic for more information.

/?                         Displays this help message.

Examples:
GPRESULT /R
GPRESULT /H GPReport.html
GPRESULT /USER targetusername /V
GPRESULT /S system /USER targetusername /SCOPE COMPUTER /Z
GPRESULT /S system /U username /P password /SCOPE USER /V

By: Jason


Copyright 2021. All rights reserved.

Posted October 18, 2011 by Timothy Conrad in category "Windows

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B