Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Run a script for a Group Policy-related task

Updated: January 21, 2005

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To run a script for a Group Policy related task

  • From the command line, enter the path and name of the script with the appropriate parameters. If cscript is not your default scripting host, be sure to precede this script name with "cscript" and enclose the path name in quotes if it contains spaces.


  • Group Policy Management Console (GPMC) provides over 30 sample scripts that you can use to perform various administrative tasks. All of the scripts are located in %programfiles%\gpmc\scripts directory on any computer where you installed GPMC.

  • All of these scripts execute from the command line. Executing a script with the /? switch displays the usage for that script.

  • The sample scripts echo output to the command window and must be executed using cscript.exe. If cscript.exe is not your default scripting host, you will need to explicitly specify cscript.exe on the command line. For example, to run the ListAllGPOs.wsf script, type the following at the command line: "cscript ListAllGPOs.wsf".

  • You can run "cscript //H:cscript" from a command line to make cscript the default scripting host.

  • These sample scripts are based on the COM interfaces that are provided by Group Policy Management Console. The interfaces are documented in the Group Policy Management Console SDK, which is located at %program%files\gpmc\scripts\gpmc.chm on any computer where you installed GPMC. The GPMC SDK is also available in the Platform SDK. The GPMC SDK is only available in English.

  • You can modify and distribute the sample scripts in accordance with the terms of the End User License Agreement.

  • For more information, see Scripting Group Policy tasks using GPMC.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft