Have you heard that you can display Group Policy reports using the command prompt and want to learn how to do it? In this detailed guide, you’ll learn all there is to know about the GPResult command.
Overview
If you’re a Windows SysAdmin, your job may include creating and deploying Group Policy Objects (GPO). After deploying a GPO, you may need to test that it is deployed correctly or troubleshoot problems with the GPO.
If you ever need to check if a GPO is deployed on users or computers, you’ll need the GPResult command.
The GPResult command displays the Resultant Set of Policy (RSoP) information for a target user and/or computer.
As I mentioned earlier, the Group Policy Result command is important for displaying the GPOs that have been applied to a user or computer. Moreover, the command provides parameters you can use to fine-tune the results it displays.
Syntax and Parameters of the GPResult Command
The syntax of the Group Policy Result command is…
gpresult [/s <system> [/u <username> [/p [<password>]]]] [/user [<targetdomain>\]<targetuser>] [/scope {user | computer}] {/r | /v | /z | [/x | /h] <filename> [/f] | /?}
In the table below, I have explained all the parameters and switches included in the command syntax above.
Parameter Name | GPResult Parameter Meaning/Notes |
---|---|
/s <system> | Specify a remote computer’s name or IP address with the /s parameter. |
/u <username> | While you use the /s parameter to specify a computer name, you use the /u parameter to specify a username that has permission to run commands on the remote computer. If you do not specify a user, the default user is the logged-in user. |
/p [<password>] | When you specify a username with the /u parameter, you may need to specify a password for the user with the permission to run the command on the remote computer you specified with the /s parameter. Then, use the /p parameter to specify the user’s password. |
/z | Use the /z parameter to display all available information about Group Policy |
/v | When you specify the /v parameter, GPResult displays verbose policy information. |
/r | Displays Resultant Set of Policy (RSoP) summary data. |
/f | Using the /f parameter Forces GPResult to overwrite the file name that is specified in the /x or /h parameter. |
/x <filename>.XML | Use the /x parameter to specify the full path to a <filename>.XML to save the report in XML. You must specify the full path to the file, including the .XML file extension. |
/h <filename>.HTML | Alternatively, use the /h parameter to specify the full path to a <filename>.HTML to save the report in HTML. You must specify the full path to the file, including the .HTML file extension. |
/user [<targetdomain>\]<targetuser>] | You can use GPResult to display the Resultant Set of Policy (RSoP) data for a domain user. To do that, specify the /user parameter. Then, specify the user in the DomainName\UserName format. |
/scope user or /scope computer | By default when you run the GPResult command, it displays RSoP for user and computer. However, if you want to display only the RSoP for a user, use the /scope user option. On the contrary, to display only the computer RSoP, use the /scope computer option. |
/? | If you want to display help information for the GPResult command, use the /? parameter. |
Some GPResult Command Examples
Now that you’ve some information about the GPResult Command, I bet you’re keen to see learn practical ways you can use the command.
Here are some common examples and applications of the GPResult Command.
How to Use the /R Parameter of GPResult Command to Return RSoP Information for the User and Computer
The most common parameter that you’ll use most of the time is the /R parameter. When you use the /R parameter of the GPResult Command, the command displays the report on the command console.
Here is a sample command.
GPResult /R
Here is the result of the command. Some of the results are now shown in the screenshot below.
How to Use the “/scope computer” Or “/scope user” Parameters of the GPResult Command
When I ran the command in the last example, the command returned RSoP information for the computer and the user.
This is the default behavior.
However, I may want to display just the RSoP information for the computer or the user.
I’ll run the command below to display the RSoP information for the computer.
GPResult /R /scope computer
The above command displays only the RSoP information for the computer.
Contrary to the above result, you may want to display the RSoP information for the user instead of the computer. To achieve this result, run the GPResult Command with the /scope user parameter:
GPResult /R /scope user
This time, the command returned only the RSoP information for the user.
How to Use the /H Parameter of GPResult Command to Export RSoP Report to an HTML File to its Default Location
As you saw in this guide’s syntax and parameter section, the GPResult command has an /H parameter. You use this parameter to export the result of this command to an HTML file.
In this example, I’ll show you how to export the result of the command to an HTML file and save the file in the default location.
So, to demonstrate how this works, I will run the command below:
GPResult /H GPOResultExample1.HTML
As you can see, I specified the name of the HTML file I want to save my report. However, I did not specify the path to save the file.
Now, let me run the command in CMD.
The screenshot below shows that command ran successfully. But there is no indication where the file GPOResultExample1.HTML is saved.
When you do not specify a file path in the GPResult Command with the /H parameter, the command saves the HTML file in your local profile folder.
To open your local profile folder, search %HOMEPATH% and open the folder.
Here is the location of my file from the last command.
How to Use the /H Parameter of GPResult Command to Export RSoP to a File Called GPREPORT.HTML By Specifying a File Location
In the last example, I showed you how to save an HTML file to the default location to which GPResult Command saves files.
In this example, I will show you how to specify a path you want to save an HTML file created by the GPResult Command.
Here is a sample command that saves GPREPORT.HTML to D:\report.
GPResult /H D:\report\GPREPORT.HTML
This time, instead of saving the file in the default location, the GPResult Command saved the file in a path I specified.
How to Use /F Parameter of The GPResult Command to Overwrite an Existing File Specified with the /X or /H Parameter
In the last two examples, I showed you how to export the result of GPResult Command to a HTML file. In addition to exporting the result of the command to an HTML file, you can also export the result of the command to an XML file.
However, if you have the file name in the same location you want to export a file, you’ll receive the error message – “A file by that name already exists”.
When you receive this message you have two options: 1, delete the existing file, or 2, use a different file name to save the new report.
However, if you do not want to do any of the above, you have a third option. You can use the /f parameter to overwrite the existing file.
How to Export GPResult Result to TXT or CSV Files
In this last example, I will show you how to export the result of the GPResult command to a txt or csv file.
To export the result of a the GPResult command to a text or csv file, send the output to a file and specify the file extension. Here are sample commands.
GPResult /R > D:\report\GPREPORT.CSV GPResult /R > D:\report\GPREPORT.TXT
Frequently Asked Questions
SysAdmins use the GPResult command to display the Resultant Set of Policy (RSoP) information for a target user and/or computer.
You can view the Gpresult information on the command prompt console. Alternatively, you can save the result in an XML or HTML file.
You can use the /h parameter of the GPResult command to save the result to an HTML file. If you do not specify a path to save the HTML file, GPResult will save the file in your profile folder.
To open your profile folder, search %HOMEPATH%. The screenshot below shows the steps in a Windows 11 PC. On a Windows 10 PC, the steps are very similar.
Yes, it does. When you run the GPResult command, it displays all Resultant Set of Policy (RSoP) information, including domain and local applied RSoP.
To export all Resultant Set of Policy (RSoP) information for a user or computer, run the GPResult command. Then, specify the /x parameter to export the results to an XML file.
Alternatively, specify the /h parameter to export the results to an HTML file.
Conclusion
The GPResult Command is a very important command to SysAdmins that deploy GPOs in a domain environment. Specifically, SysAdmins use this command to troubleshoot GPO deployment.
In this guide, you read the overview of the GPResult Command. Then, you also learned its syntax and parameters.
Not only that, but the guide also discussed some examples of this all-important command.
I hope you found this guide helpful? If you found the guide helpful, kindly share the part of the guide you found most helpful. To share your feedback, reply to this article’s topic using the “Leave a Reply” form at the bottom of this page.
Alternatively, you can respond to the “Was this page helpful?” question below.
Finally, to read more Windows Command Prompt guides, visit our Windows Command Prompt Guides page.
Thanks for this!
Worked fine for me! 🙂
Here is a post for German users:
https://www.itnator.net/gpresult-parameter-rsop-daten-anzeigen/
Sabine