Task Sequences
Task sequences are a core element for any OSD operation. They consist of a series of customizable tasks or sequentially performed steps. Many tasks types are built into ConfigMgr, and MDT adds a handful of useful tasks as well. In addition, you can create your own tasks using the ConfigMgr Software Development Kit (SDK) if you cannot find one that fits your needs.
The New Task Sequence Wizard, available from the context menu or ribbon bar of the Task Sequences node by selecting Create Task Sequence , quickly builds one of two default task sequence types or a custom task sequence:
- Build and Capture: This type of task sequence builds an OS image for you by performing the following steps:
- Installs Windows from an OS installer
- Installs software updates
- Installs software you want to include in the image
- Performs any other customizations you want to include in the image
- Prepares a system to be captured to an image by sysprepping it
- Captures an image of the system to a WIM file
- Deploy an Image: This type of task sequence deploys an OS image performing these steps:
- Optionally captures use state and data
- Prepares the hard drives
- Applies an OS image contained in a WIM file to the local hard disk
- Installs software updates
- Installs additional software
- Performs any other customizations
- Optionally restores user state and data
These two task sequence types take care of a majority of the scenarios in OSD (the "Image Operations" section includes walkthroughs); however, task sequences are flexible and not limited to what is produced by default. The task sequence editor allows easy customization of the task sequences; you can tailor task sequences to the specific OSD needs of an organization- and with a little imagination, software deployment.
The wizard also presents the option to build a custom task sequence; task sequences built using the custom option are initially blank and can be used for OSD task sequences built from scratch or non-OSD task sequences such as application deployment or software updates where a series of multiple actions are ordered and performed on the target system. Non-OSD task sequences were traditionally used in ConfigMgr 2007 in place of writing scripts, for inserting reboots into a set of tasks, or coordinating multiple tasks that must occur in a sequence at a given scheduled time. Using task sequences for non-OSD tasks, although discouraged in ConfigMgr 2012 because of the new application management capabilities specifically designed by the product team to provide all the capabilities that administrators use non-OSD task sequences for (and more of course), is still possible and has some benefits. Using task sequences in this manner is not explicitly covered in this tutorial, but relatively straightforward.
Starting with the wizard-created deployment or Build and Capture task sequences is highly recommended because it properly inserts and orders a minimum set of tasks.
To edit a task sequence after creation, right-click it and choose Edit (choosing Properties from the context-menu results in the Properties dialog box of the task sequence and not the task sequence editor). Adding a task is a matter of choosing the Add drop-down menu, choosing a task category, and then selecting the task. Each task is customizable and has its own configurable parameters as discussed next.
Task Sequence Phases
Task sequences are not formally broken down into phases, but there are clearly different parts of the task sequence. Knowing what these different parts are responsible for is important to knowing how to organize your task sequence and how to troubleshoot it.
- Startup: This optional phase of the task sequence runs in a system's currently
installed OS. This typically includes capturing the existing user data and saving it
to an SMP or to the local hard disk using hard linking. Other possible tasks include
upgrading the BIOS of the system, soliciting user input, or gathering other information
about the system's current state or role.
This phase ends with a reboot into WinPE. - WinPE: This phase executes completely in WinPE and prepares the system for
Windows installation. It includes hard-drive preparation, unattended file creation
and modification, and copying all files needed for Windows installation to the harddrive
including drivers and OS installation files.
This phase ends with a reboot to the OS installation files copied to the hard drive. - Windows Setup: This phase runs Windows setup or mini-setup from the OS installation
files copied to the hard drive-mini-setup is used if the OS installation files
are from a sysprepped image, and full setup is run if they are from the installation
media. Windows setup uses the information in the unattended file created
and modified in the previous phase to ensure this phase is completely unattended.
Applicable drivers are also installed by Windows setup, based upon what was copied
to the hard disk in the WinPE phase and a plug-and-play scan of the existing hardware in the system.
This phase ends with a reboot into the newly installed Windows OS. - Post-Windows: After Windows is installed, all other configurations that depend on
the existence of a working installation of Windows are performed; thus, this phase
executes in the newly installed Windows instance. This includes installing updates,
applications, and performing any other customizations.
This phase ends when all tasks are finished in a normal deployment scenario. For Build and Capture task sequences, this phase ends when the preparation for imaging tasks begin. - Image Capture: This final build and capture-only phase starts by preparing the
ConfigMgr agent for imaging and sysprepping Windows; both of these tasks are
performed in the newly installed Windows instance. Finally, the system is rebooted
into WinPE, and the instance of Windows just installed is captured to a WIM file.
This phase ends when the image process completes. The system is rebooted after the image creation is complete; however, the system boots into the sysprepped version of the OS. Because no unattended setup file is available, the process stops to wait for user input at the beginning of mini-setup.
You can also execute commands before a task sequence even begins, using either a prestart command (discussed in the "Boot Image Customization" section) or by setting a program to run first (discussed in the next section) on the task sequence itself. Prestart commands execute in WinPE before the task sequence is executed and are a function of the boot image. Program dependencies execute in the current OS and only execute if the task sequence is initiated from the OS. Reasons for using one of these techniques include one or a combination of the following:
- Display a UI to the interactive to allow them to choose from a set of options.
- Configure the value of one or more task sequence variables used in the task sequence itself.
- Perform some other preparation of the system such as removing it from Active Directory, upgrading its BIOS, or checking the disk for errors.
In this tutorial:
- Operating System Deployment
- What is OSD
- What is New in OSD
- Deployment Scenarios
- Tools Incorporated into OSD
- Windows Automated Installation Kit
- User State Migration Tool and USMT Customization
- OSD Phases
- OSD Building Blocks
- Driver Packages
- Operating System Installers
- Drivers in Boot Images
- Task Sequences
- Task Sequence Properties
- Task Placement
- Task Conditions and Grouping
- Targeting and Execution
- Execution Context
- Customizing Task Sequences
- Site System Roles
- Multicast
- State Migration Point
- Driver Management
- Drivers in the Image
- User State
- USMT
- Computer Associations
- User State Without SMP
- Image Operations
- Manual Image Creation
- Image Upkeep
- Image Deployment
- User Device Affinity
- Deployment Challenges
- Hardware Considerations
- Monitoring Task Sequence Deployments
- Troubleshooting Operating System Deployment
- The Smsts.log File