Jaa


Deploy Office 2010 by using Group Policy computer startup scripts

 

Applies to: Office 2010

Topic Last Modified: 2011-08-05

Banner stating end of support date for Office 2010 with link to more info

You can use Group Policy to assign computer startup scripts to deploy Microsoft Office 2010 by using the technical guidance in this article. You can write a script in any language that is supported by the client computer. Windows Script Host-supported languages, such as VBScript and Jscript, and command files, such as a batch file, are the most common.

Deploying Office 2010 in a test environment

This section provides an illustration and description of the test network environment for the Group Policy computer startup script infrastructure. It also includes procedural steps for deploying Microsoft Office Professional Plus 2010 by using a Group Policy computer startup script.

Network environment

The test network environment for this article is shown in the following illustration.

Test network for Group Policy startup script

All of the servers (A and B) are running Windows Server 2008 R2 and are members of the same domain (CPANDL.COM), including the client computers (C), which are running Windows 7 Professional and Windows Vista. The fully qualified domain name (FQDN) for each client computer, the applications and roles that each server is running, the organizational unit (OU) with included computers, and the Group Policy object (GPO) are listed as follows:


  • A – <DC.CPANDL.COM> Active Directory, DNS, DHCP, GPO-Office2010_GPO, OU-Office2010_OU, W7C01 and WVC02 are members of the OU, Office2010_OU


  • B – <FS.CPANDL.COM> File Services, file share-\\FS\Office2010SourceFiles (Read Only access), file share-\\FS\Office2010LogFiles (Read Write access)


  • C – <W7C01.CPANDL.COM and WVC02.CPANDL.COM> Windows 7 Professional and Windows Vista Enterprise

Important

Ensure that Authenticated Users have Read access to the network share. In this example, the network share is \FS\Office2010SourceFiles.

Note

Office2010_GPO is linked to Office2010_OU. This allows for the settings of the GPO to be assigned to the computer objects that are contained within the OU. To link a GPO to an OU use the MMC snap-in Group Policy Management.

Before you customize and deploy Office 2010 in your production environment, we recommend that you read the following articles: Plan volume activation of Office 2010, Deploy volume activation of Office 2010, Customization overview for Office 2010, Create a network installation point for Office 2010, Office Customization Tool in Office 2010, Config.xml file in Office 2010, Customize Office 2010, and 64-bit editions of Office 2010.

Customize Setup for Office 2010

The program file to create a setup customization file for Office 2010 is run from the source directory that contains a copy of all the files from the Office installation CD. In this example, the source files were copied to \\FS\Office2010SourceFiles.

In Office 2010, Setup controls the complete installation. This includes processes that Windows Installer handled in Office versions earlier than the 2007 Office system. Customizing the default behavior of Setup lets you control the process. In this example, you use the Config.xml file to customize the installation for a silent installation of Office 2010 and the Office Customization Tool (OCT) to customize the installation of Office 2010 products, such as specifying the volume license key and selecting which applications from Microsoft Office to install. Setup applies the customizations from both the config.xml and .msp file (created by using the OCT) when Office is installed on the computers.

To specify silent installation options in Config.xml

To configure a silent installation (unattended installation) of an Office 2010 product that requires no user interaction, modify the Config.xml file for the product that you are installing and set the Display element's Level attribute to "none" (Display Level="none"), and then save the Config.xml file, as shown in the following procedure. The Display element specifies the level of user interface that Setup displays to users.

  1. Open the Config.xml file for the Office product, which in this example is Office Professional Plus 2010, that you are installing by using a text editor tool, such as Notepad. By default, the Config.xml file is located in the core products .WW folder, which in this example is \\FS\Office2010SourceFiles\ProPlus.WW.

  2. Locate the line that contains the Display element, as shown in the following example:

    <!-- <Display Level="full" CompletionNotice="yes" SuppressModal="no" AcceptEula="no" /> -->

  3. Modify the Display element entry with the silent options that you want to use. Make sure that you remove the comment delimiters, "<!--" and "-->". For example, use the following syntax:

    <Display Level="none" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />

    These options will direct Setup to run silently, prevent prompting users to enter information, and prevent the installation from waiting for any user interaction. For more information about the syntax and Config.xml, see Display element in Config.xml file in Office 2010.

  4. Save the Config.xml file, which in this example is saved to \\FS\Office2010SourceFiles\ProPlus.WW.

To specify the volume license key and select which applications to install using the OCT

  1. To customize Office Setup, use the command line setup.exe /admin to start the Office Customization Tool. In this example, at a command prompt, run setup.exe /admin from the package source directory, \\FS\Office2010SourceFiles.

  2. In this example, to enter the volume license key and select which applications to install, modify and configure the settings as follows:

  3. Select the Enter another product key option located under Licensing and user interface, and then enter a valid Multiple Activation Key (MAK) key.

    Note

    In this example, because the parameters for a silent installation were configured in the Config.xml file, it is not necessary to also configure them when using the OCT. This is because the customizations that you define in Config.xml take precedence over those in the customization file created by using the OCT.

  4. Select the Set feature installation option located under Features, and then select which applications to install. In this example, to speed up the installation process, only Microsoft Word was selected.

    For additional resources on some of the different parameters you can configure when you use the OCT, see Office Customization Tool in Office 2010, Configure feature installation states for Office 2010, and Configure user settings for Office 2010.

  5. Save and name the newly created .msp file, and then put it in the \Updates folder for Office 2010 on the computer that contains the source files, which in this example is \\FS\Office2010SourceFiles\Updates\Office2010ProPlus.MSP.

Warning

Only one Setup customization .msp file per product in the Updates folder is supported. If you are deploying an initial installation of Office 2010 and you also want to deploy Office 2010 software updates, such as service packs and hotfixes, Setup can apply the product updates as part of the installation process. You can place the Office 2010 product updates, which are applied after the installation is complete, in the Updates folder. For more information, see Office Customization Tool in Office 2010

The next step is to configure the script on the domain controller, which in this example is DC.CPANDL.COM.

Configure script on domain controller

The process for configuring the script on the domain controller involves the following steps:

  1. Copy script to startup folder for GPO.

  2. Add script to GPO.

  3. Set maximum run time for startup script.

Warning

Group Policy provides the ability to affect configurations across hundreds and even thousands of computers in an organization. Therefore, it is very important that you rigorously test all new Group Policy configurations or deployments in a test environment before you move them into your production environment. For detailed information about staging Group Policy deployments, see Staging Group Policy Deployments in the Group Policy Planning and Deployment Guide (https://go.microsoft.com/fwlink/p/?LinkID=182208&clcid=0x409).

Copy script to startup folder for GPO

This example includes a sample batch file script, which illustrates how to run Microsoft Office Setup.exe if the product is not already installed and log error or success to a centralized log file. The variables at the beginning of the script were modified for this test deployment scenario. For example, the product name of ProPlus with a prefix of Office14 and the paths for the Office source files, \\FS\Office2010SourceFiles, and log files, \\FS\Office2010LogFiles, were added. This sample script was then copied to Notepad and saved with the file name of Office2010StartupScript.bat.

Tip

Although, in this example, we save the script file with a .bat file name extension it is also possible to save the file with a .cmd file name extension. This may be necessary if a policy that prohibits .bat files from running exists within your environment.

The script file is then saved on the domain controller to the default directory of the GPO for startup scripts, which in this example is C:\Windows\SYSVOL\sysvol\adatum.com\Policies\{GUID of GPO}\Machine\Scripts\Startup.

Note

The GUID representing the GPO can be found in the MMC snap-in Group Policy Management Editor by right-clicking the GPO, which in this example is Office2010_GPO, and then clicking Properties. The GUID is listed in the Unique name field.

setlocal

REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************

REM Get ProductName from the Office product's core Setup.xml file, and then add "office14." as a prefix. 
set ProductName=Office14.PROPLUS

REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\FS\Office2010SourceFiles

REM Set ConfigFile to the configuration file to be used for deployment (required)
set ConfigFile=\\FS\Office2010SourceFiles\ProPlus.WW\config.xml

REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\FS\Office2010LogFiles

REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************

IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86)

REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 uninstall key
:ARP64
reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if NOT %errorlevel%==1 (goto End)

REM Check for 32 and 64 bit versions of Office 2010 in regular uninstall key.(Office 64bit would also appear here on a 64bit OS) 
:ARP86
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto End)

REM If 1 returned, the product was not found. Run setup here.
:DeployOffice
start /wait %DeployServer%\setup.exe /config %ConfigFile%
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt

REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End

Endlocal

Add script to GPO

To add the script to the GPO use the MMC snap-in Group Policy Management Editor and right-click Startup (GPO | Computer Configuration | Policies | Windows Settings | Scripts (Startup/Shutdown) | Startup), click Properties, Add, Browse and then highlight and select the script file, which in this example is Office2010StartupScript.bat.

Set maximum run time for startup script

By default, the system lets combined sets of scripts run for up to 600 seconds (10 minutes) only. Administrators can use a policy setting to adjust this interval to ensure the startup script completes running. The Maximum wait time for Group Policy scripts policy setting specifies how long the system waits for scripts applied by Group Policy to run. This setting limits the total time allowed for all logon, startup, and shutdown scripts applied by Group Policy to finish running. As with any Group Policy deployment, you must fully test your startup scripts in a staging environment before you deploy them to your production environment. Testing will help you determine the value to use for the Maximum wait time for Group Policy scripts policy for your particular network environment. Setting this value too low may cause the installation to terminate prematurely. There are factors that may affect this value, such as network speed, client computer hardware, and other scripts running on the client computer. By fully testing this policy setting, you can determine the appropriate value to use for your specific environment.

In this example scenario the value for the Maximum wait time for Group Policy scripts policy setting was set to 0, which directs the system to wait until the scripts have finished, regardless of how long they take.

To change the value of the Maximum wait time for Group Policy scripts policy of the GPO, which in this example is Office2010_GPO, use the MMC snap-in Group Policy Management Editor and double-click Maximum wait time for Group Policy scripts (GPO | Computer Configuration | Policies | Administrative Templates | System | Scripts).

After the computer startup script policy changes that have been made to the GPO are applied to the targeted computers, which in this example are W7C01.CPANDL.COM and WVC02.CPANDL.COM, then the computer startup script will execute by a computer startup. Instead of waiting for the policy refresh from the domain controller to take place on the client computers, you can issue the following command line, gpupdate /force, at a command prompt on the client computers. You can use the Resultant Set of Policy (RSoP) MMC snap-in to verify that the computer policy setting for the computer startup script is present on the client computer.

Verify computer startup script status

In this example, script logging information is written to computername.txt file and saved to the network share, \\FS\Office2010LogFiles. A return code of 0 in the log file indicates that the installation completed successfully. A return code of 3010 indicates that a restart is required. For more information about other error codes for Windows Installer processes for Office products, see Microsoft Knowledge Base article 290158: List of error codes and error messages for Windows Installer processes in Office 2003 products and Office XP products.