Deploy Office with a script assigned by a Group Policy

Configure the installation script as a computer startup script by using Group Policy

After you test the installation script, do the following:

Create a Group Policy Object (GPO)

To create a Group Policy Object, use the Group Policy Management Console (GPMC). By default, only domain administrators, enterprise administrators, and members of the Group Policy creator owners group in AD DS can create and edit GPOs. For more information about how to use the GPMC, see Group Policy Management Console.

One possible configuration is to create an organizational unit (OU) in AD DS and place the computers on which you want to install Office into that OU. Then, create the GPO and link the GPO to that OU.


Group Policy enables you to affect configurations across hundreds and even thousands of computers in an organization. Therefore, make sure that you rigorously test all new Group Policy configurations or deployments in a test environment before you move them into a production environment.


Copy the script to the Startup folder for the GPO

After you create the GPO, copy the script to the Startup folder for the GPO on a domain controller for the Active Directory domain. The path of the Startup folder for the GPO is as follows:

%systemroot%\sysvol\domain\Policies\{GPO ID}\Machines\Scripts\Startup


  • %systemroot% is an environment variable that represents the drive and folder where the operating system is installed. For example, c:\windows.

  • {GPO ID} is the unique ID for the GPO. For example, {467FE97D-0A65-4EE1-AE41-EB9A27E7DC7A}. To find the ID for the GPO, select the GPO in the GPMC, and then in the details pane, select the Details tab. The ID is listed as Unique ID on the Details tab.

The GPO and the script are replicated automatically to all domain controllers in the domain.

Configure the GPO to use the script as a computer startup script

After you copy the script to the Startup folder for the GPO, configure the GPO to use the script as a computer startup script. To configure the GPO, use the GPMC and follow the steps in the Assign Computer Startup Scripts.

By default, the total time that the system waits for all logon, logoff, startup, and shutdown scripts that are applied by Group Policy to finish running is 600 seconds (10 minutes). If necessary, you can use the "Maximum wait time for Group Policy scripts" Group Policy setting to adjust this time to make sure that the startup script finishes running. The path of this setting in the GPMC, when you edit a GPO, is Computer Configuration\Policies\Administrative Templates\System\Scripts.



To assign computer startup scripts

  1. Open the Group Policy Management Console (GPMC). Right-click the Group Policy object (GPO) you want to edit, and then click Edit .

  2. In the console tree, click Scripts (Startup/Shutdown) . The path is Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown) .

  3. In the results pane, double-click Startup .

  4. In the Startup Properties dialog box, click Add .

  5. In the Add a Script dialog box, do the following:

    • In Script Name , type the path of the script, or click Browse to search for the script file in the Netlogon shared folder on the domain controller.

      You must enclose the script path and script name with double quotes when specifying a script name or script path that includes spaces, in order for the scripts extension to correctly run all scripts.
    • In Script Parameters , type any parameters that you want, exactly as you would type them on the command line. For example, if your script includes parameters called //logo (display banner) and //I (interactive mode), type //logo //I .
  6. In the Startup Properties dialog box, specify the options that you want:

    • Startup Scripts for <Group Policy object> : Lists all the scripts that currently are assigned to the selected GPO. If you assign multiple scripts, the scripts are processed in the order that you specify. To move a script up in the list, click it, and then click Up . To move a script down in the list, click it, and then click Down .
    • Add : Opens the Add a Script dialog box, where you can specify any additional scripts to use.
    • Edit : Opens the Edit Script dialog box, where you can change script information, such as name and parameters.
    • Remove : Removes the selected script from the Startup Scripts list.
    • Show Files : Displays the script files that are stored in the selected GPO.

Additional considerations

  • To complete this procedure, you must have Edit setting permission to edit a GPO. By default, members of the Domain Administrators security group, the Enterprise Administrators security group, or the Group Policy Creator Owners security group have Edit setting permission to edit a GPO.
  • Startup scripts are run under the Local System account, and they have the full rights that are associated with being able to run under the Local System account.
  • In Windows® 7 and Windows Vista®, startup scripts are run asynchronously, by default. This is a different behavior from earlier operating systems.
  • Setting startup scripts to run synchronously may cause the boot process to run slowly.
  • In Windows 7 and Windows Vista, startup scripts that run asynchronously will not be visible. Enabling the Run Startup Scripts Visible Group Policy setting has no effect when you are running startup scripts asynchronously.