What Is Scripts Extension?

What Is Scripts Extension?

Active Directory domains in a Windows 2000 Server and Windows Server 2003 network use the Scripts extension to run scripts on client computers. The Scripts extension consists of two components; an MMC server-side snap-in and a client-side extension (CSE). A Group Policy CSE is a dynamic-link library (DLL) on the client (target) that interacts with the Group Policy infrastructure and that implements Group Policy scripts on the target. You can control how the Scripts CSE implements scripts by using the Group Policy Object Editor on the server. The following figure shows Group Policy Object Editor, a Microsoft Management Console (MMC) snap-in with the scripts node.

Group Policy Object Editor

Editor de objectos de política de grupos

Before the introduction of the GPO Scripts extension, user logon scripts were added to the user account object. Only one script was added to the object, and the script was a user script; no computer scripts were allowed.

The Scripts CSE now allows the following four script types, corresponding to four of the target events triggering the Scripts extension:

  • User logon scripts
  • User logoff scripts
  • Computer startup scripts
  • Computer shutdown scripts

Other Scripts extension trigger events are:

  • User policy refresh event
  • User policy force refresh event
  • Computer policy refresh event
  • Computer policy force refresh event
  • Secedit tool or gpupdate

These events tell the computer which scripts need to be run at each script execution opportunity; these events do not run the scripts.

Scripts are now added to the Group Policy object (GPO), and multiple scripts for each script type can be added to the GPO. A script can be written in any language supported by the client computer, with Windows Script Host (WSH) supported languages and command files being the most common. WSH languages include VBScript and JScript, which are the languages used for the sample scripts included with Group Policy Management Console (GPMC).

Script names and their command-line arguments are stored in the registry when script policy processes. You can specify Administrative Templates Group Policy settings that modify how Group Policy scripts behave by using the options shown in the following table.

Computer Configuration Script Options

Option Description

Run logon scripts synchronously

Enable this option to force the system to run the scripts synchronously, one after another. This option exists for computer and user configuration, which can have a different value. In case of conflict, the computer configuration setting prevails.

Run startup scripts asynchronously

The default setting is for scripts to run synchronously (and hidden). Use this option to optimize the startup/logon processes so users can logon before startup scripts have finished.

Run startup scripts visible

Enable this option to run startup scripts in a visible window.

Run shutdown scripts visible

Enable this option to run shutdown scripts in a visible window.

Maximum wait time for Group Policy scripts

Use this option to set the script timeout interval. The default interval is 600 seconds (10 minutes), and valid intervals range from 0 to 32000 seconds.

You can specify user configuration Group Policy settings that modify how Group Policy scripts behave by using the options shown in the following table.

User Configuration Script Options

Option Description

Run logon scripts synchronously

Enable this option to force the system to run the script synchronously, one after another. This option also exists for Computer configuration, which can have a different value. In case of conflict, the computer configuration setting prevails. On computers running Windows XP, the explorer starts before scripts finish running.

Run legacy logon scripts hidden

Enable this option to run legacy, Windows NT version 4–type logon scripts hidden. By default these run visible and so can be canceled by users.

Run logon scripts visible

Enable this option to run logon scripts in a visible window.

Run logoff scripts synchronously

Enable this option to run logoff scripts before the user logs off.