DEV Community

Victor James
Victor James

Posted on • Originally published at windowscmd.com on

GPRESULT Windows Command

GPRESULT

GPRESULT

The GPRESULT windows command-line tool displays the Resultant Set of Policy information.

CMD Line

CMD Line is a text-based interface that transfers the command from the user to the OS.

CLI-Command Line Interpreter

The command-line interpreter (CLI) for windows is CMD.EXE. Also, you can use PowerShell which can automize many system administration tasks and these tasks are not approachable in command prompt. With the help of the CLI, you can communicate with your system by typing the text in commands. As a result, your system answers to the text that you have typed previously, and then the user can proceed with the next command line that shows up.

To open the Run command Window

Run command window helps you to run programs, open the files and folders. And there are several ways to open up the run command dialog box. This run command box is useful for you to head straight to the destined program easily.

By using the Keyboard shortcut Key:

WINDOWS+R

One of the most commonly used methods is the Shortcut key method. Also, this method is in all versions of Windows. You need to press the Windows+ R key concurrently to open the Run command dialog box.

Run command box
Run command box

What does the GPRESULT command do?

The GPRESULT windows command line tool is to display the Resultant Set of Policy information. This command shows the resultant set of policy information for a remote user and computer. For to use this, you should have firewall rules that enable inbound network traffic on the ports.

Syntax


 gpresult [/s Computer [/u [Domain\]UserName [/p [Password]]]]
   [/user [TargetDomain\]TargetUser] [/scope {user | computer}]
             [/r | /v | /z] [[/x | /h] FileName [/f]]

Enter fullscreen mode Exit fullscreen mode

Parameter Explanation

  • /s – The name or IP address of a remote computer, do not use backslashes.
    • Default = local computer
  • /u []– Executes the command with the credentials of the specified user.
    • Default = currently logged on user
  • /p []– The password of the user account that is provided in the /u parameter. If /p is omitted , gpresult prompts for the password.
  • /user []– The remote user whose RSoP data is to be displayed.
  • /scope {user | computer} – Displays RSoP data for either the user or the computer. If /scope is omitted, gpresult displays RSoP data for both the user and the computer.
  • [/x | /h]– Stores the report in either XML (/x) or HTML (/h) format at the location and with the file name specified by the FileName parameter. Cannot be used with /u, /p, /r, /v, or /z.
  • /fForce gpresult to overwrite the file name specified in the /x or /h option.
  • /r – Display RSoP summary data.
  • /v – Display verbose policy information.
  • /z – Display all available information about Group Policy.
  • /? – Display help.

In Windows Vista/7/2008 the /f and /r options were introduced.

Examples

  • In order to retrieve RSoP data for only the remote user , maindom\hiropln with the password p@ssW23, who’s on the computer srvmain, you can use

C:\> gpresult /s srvmain /u ss64dom\hiropln /p p@ssW23 /user targetusername /scope user

Enter fullscreen mode Exit fullscreen mode
  • To display RSoP data for the logged-on user , maindom\hiropln with the password p@ssW23, for the computer srvmain you can use

C:\> gpresult /s srvmain /u ss64dom\hiropln /p p@ssW23

Enter fullscreen mode Exit fullscreen mode
  • In order to save all available information about Group Policy to a file named, policy.txt, for only the remote user maindom\hiropln with the password p@ssW23, on the computer srvmain use

C:\> gpresult /s srvmain /u ss64dom\hiropln /p p@ssW23 /user targetusername /z >policy.txt

Enter fullscreen mode Exit fullscreen mode

Verdict

In this guide, we have seen the GPRESULT windows command line tool in detail with its syntax and examples. If you want to know more about the windows command line, visit our website.

Related articles

  • GPUPDATE The GPUPDATE windows command-line tool is used to update the Group Policy settings.
  • FTYPE The FTYPE windows command-line tool is to display or else changes File type utilized in extension file associations. FTYPE is an Internal command.
  • GETMAC The GETMAC windows command-line tool is to display the Media Access Control (MAC) address and a list of network protocols.
  • GPRESULT The GPRESULT windows command-line tool is to display the Resultant Set of Policy information.
  • GOTO The GOTO windows command-line tool is to direct a batch program to jump to a labeled line. This command directs the command processing to a line that is identified by a label within a batch program.

The post GPRESULT appeared first on Windows Commands- SS64 Commands.

Discussion (0)