Adding actions to a provisioning template

The following actions are described in this section:

Use the Add action dialog box to create new actions for provisioning templates, or to edit the actions of existing templates. Public templates are visible to all users. Templates in the My templates group are not visible to all users, and can only be modified by the template creator or by users with administrative rights.

Actions are ordered in five sections. You can only select actions in each section that can apply to the section (for example, you can't select Software distribution as an action for the Pre-installation section). You can add any available action to any section, but be aware that some actions will break the template or may render your system unusable if completed in the improper steps.

The Condense toolbar button rewrites the current parent template to incorporate all included templates, so that all actions from the included templates become part of the parent template. This means that the parent template has no more dependencies. This is useful for exporting templates or making templates public. Once a template is condensed, it is a new template. You can't expand a condensed template.

To add actions to a template
  1. Click Tools > Distribution > OS Deployment.
  2. Under Provisioning templates, click Public or My templates to display templates.
  3. Double-click a template.
  4. In the Template view, click Action list.
  5. Click the section you want to add an action to. You can choose from these sections:
  1. Click Add.
  2. Type a specific name for the action in the Name box.
  3. Type a detailed description of the action in the Description box.
  4. Select an action type from the Type list. The type you select will determine what options you'll need to specify for the action. See below for more information on the specific action types.
  5. If you want to add a variable that applies to this action only, click Add under Action variables. Type the name and value of the variable in the text boxes,  and click Save.
  6. Select Stop processing the template if this action fails if you want to define an action as essential to the provisioning task. If the action can be ignored, clear this check box.
  7. When finished, click OK.

Action types

The table below displays the action types and where they fit into sections by default. You can add any action type to any section, but note that some actions inherently fit in certain sequences in provisioning, and if an action is executed outside its intended sequence, unintended consequences may occur.

Action name System migration Pre-OS installation OS installation Post-OS Installation System configuration
Capture image     X    
Configure agent         X
Configure target OS       X  
Control service         X
Copy file X X X X X
Create directory X X X X X
Delete file X X X X X
Deploy image     X    
Distribute software         X
Download file X X X X X
Execute file X X X X X
Hardware-independent imaging       X  
Inject script X X X X X
Install service         X
Join domain         X
Map/Unmap drive X X X X X
Partition   X X X  
Patch system         X
Reboot/Shutdown X X X X X
Replace text X X X X X
Scripted install     X    
Uninstall service         X
Unzip file X X X X X
Update registry         X
Wait X X X X X

Capture image (OS installation section only)

The Capture image action lets you capture an image at the time of OS installation, through the use of the imaging tool you specify. If the tool or the contents to be captured in an image are located on a share, you must place the Map drive action prior to the Capture image action in order to authenticate to the share.

NOTE: To avoid the problem of the file system being locked open in WinPE, you must first Sysprep your image. In Windows Vista, follow the steps below.

  1. Boot into Vista.
  2. Change to the %SystemRoot%\System32\sysprep directory.
  3. Run "sysprep /generalize /shutdown".
  4. Boot to the PE and run ImageX.

The Windows XP/2003 steps don't require the /generalize and /shutdown switches for sysprep. The /factory switch should work on those operating systems.

Configure agent (System configuration section only)

The Configure agent action lets you select an agent configuration to install on the provisioned device. This action should be the first thing done after the reboot that follows the OS install actions. Configurations are added to the drop-down list as you create them in Agent configuration. This action can only be completed as part of a template that includes either the Scripted install or Deploy image actions, or if the client machine has already been configured with an agent.

When you install a new service pack, the agent configuration database IDs change. This means that the templates referencing those configurations become outdated. As a result, any provisioning history referencing those configurations will be unable to display the name of the configuration it once referenced, and any template referencing the old configurations will need to be updated before it will run correctly. The configuration name is not displayed in the History page, and if you try to re-schedule this template, it will fail on the Agent Configuration action because of this problem. To fix it, you must clone the template, open the cloned template, open the Agent Configuration action, and assign the configuration you want to use. Then the task will run successfully.

Configure target OS (post-OS installation section only)

This action inserts the provisioning agent (ldprovision) into an image so that the agent can be installed after reboot. It is required for continued provisioning after the new OS starts. For this action to work, the following conditions must be met:

  1. The Windows system drive must be mounted.
  2. The Windows file system must be either sysprepped or have an agent on the machine
  3. Linux can't have any uncommon file systems (xfs, jfs, bobfs). The reiserfs and ext2/3 OSes are the only current valid supported OSes.
  4. The Linux root system can't be on a software RAID controller, or be on a software RAID (md's). Real hardware RAID configurations are allowed, as long as the controller driver is recognized by the PE.

This action should be performed as the last action in the post-OS installation section because it includes a reboot operation.

Control service (System configuration section only)

The Control service action starts, stops, or restarts a specified service. The target OS must be Windows for this action.

Copy file (all sections)

The Copy file action copies files to specific locations on the target device. Both the source and destination can be located on a share. If this is so, you must include a Map drive action prior to the Copy file action. The Copy file action can be recursive, meaning that all files/folders below the source path can be copied, maintaining their original structure. Wildcard characters are supported (such as *.exe or ld*.*).

Create directory (all sections)

The Create directory action creates a directory in the specified location and can create the parent directory, if needed.

Delete file (all sections)

The Delete file action removes files in specific locations on the target server. The path can be located on a share. If this is so, you must include a Map drive action prior to the Delete file action. The Delete file action can be recursive, meaning that all files/folders below the source path can be deleted. Wildcard characters are supported (such as *.exe or ld*.*).

Deploy image (OS installation section only)

This action deploys the selected image to the target server through the use of the imaging tool you specify. If the tool or the image to be deployed are located on a share, you must place the Map drive action prior to the Deploy image action in order to authenticate to the share.

You must manually reboot after deploying an image.

Distribute software (System configuration section only)

This action distributes a software distribution package to the target. You can choose from any distribution package that you have saved in the Distribution packages tool. This action can only be completed after the agent configuration action, or after agents have been installed on the device.

Download file (all sections)

The Download file action downloads the selected file using an anonymous user (anonymous HTTP login) to a destination you specify. If the files to be downloaded or the destination are located on a share, you must place the Map drive action prior to the Download file action in order to authenticate to the share.

Execute file (all sections)

The Execute file action executes the selected file on the targeted server, along with any command-line parameters or return codes you specify.

Hardware-independent imaging (Post-OS installation only)

The Hardware-independent imaging action includes the hardware-independent imaging tool (hiiclient.exe) in the provisioning process. Hardware-independent imaging (HII) lets you create a single provisioning template or deployment script that can be deployed to multiple device models. A base image is installed on the device, and the HII tool then injects drivers that are specific to the device model.

This action is only included in the Post-OS installation section for templates based on the Windows preboot environment. After the OS is installed, but before the device reboots, the HII tool detects the device model and retrieves drivers for that model. The drivers are installed onto the device and their information is included in the registry. After a reboot, when the OS starts it configures the drivers.

If you use this action, include a Reboot action after it in the Post-OS installation section.

For more information about hardware-independent imaging, see Hardware-independent imaging.

Inject script (all sections)

This action injects a script into the target OS file system. You can inject sysprep.inf into the Deploy image action or unattend.txt into a Scripted install action. The Inject script action can only be done after the OS install action and before the first reboot that follows the OS install. The scripts that you can select are those in the Install scripts list that can be applied to the current template.

Install service (System configuration section only)

The target OS must be Windows for this action.

Join domain (System configuration section only)

Joins target device to a domain or workgroup.

Map/Unmap drive (all sections)

Map a drive or connect to a resource to access vital files to complete actions in a section or disconnect a drive or resource. Please note that some systems do not accept drive mappings below drive H.

Partition (Pre-OS installation, OS installation, Post-OS installation sections only)

The Partition action lets you complete a variety of actions relating to partitions on the target server. Select partition actions from the Action type list. The actions are listed below.

NOTE: The boot environment and target OS must be set prior to executing this action.

Create partition: Create a partition on the specified disk.

Remove partition: Delete a partition on the specified disk.

Remove all partitions: Delete all partitions on the disk.

Format partition: Create a file system structure on a partition.

Mount partition: Mount a partition.

Unmount partition: Unmount a partition.

Make bootable: Make a partition bootable.

Expand partition: Expands the last partition on the drive. Free space must be available.

Patch system (System configuration section only)

The Patch system action scans the target device for vulnerabilities and remediates them. This action can only run after a Configuration action that installs the Software updates agent is run.

The core vulnerability definitions should be updated prior to executing this action. All patches to be remediated must be downloaded on the core before executing either remediation option in this action.

Reboot/Shutdown (all sections)

Reboot or shut down the server. A reboot must immediately follow the OS install action. Upon reboot, the provisioning agent restarts the template to continue the progression of provisioning tasks. Use the Reboot action to move from System migration section to OS sections or OS sections to System configuration section. Multiple reboots are supported.

Replace text (all sections)

Replace text in an existing file.

Scripted install (OS installation section only)

Install an operating system through the use of custom scripts. There can only be one action that installs an OS.

Windows
Linux

Uninstall service (System configuration section only)

Uninstall a service on the target device.

Unzip file (all sections)

Unzip the contents of a package to a predetermined location. This action can restore original structure.

Update registry (System configuration section only)

This action adds or removes keys or values to the registry, or imports a registry (.reg) file. Editing the registry incorrectly may damage your system, potentially rendering it inoperable. Before making changes to the registry, you should back up any valued data on your computer.

Select an operation from the Registry operation list.

Wait (all sections)

Pause the template execution for a specified time or until a required file has been created.