Dynamic Application Deployment - Configuration Manager, MDT, Orchestrator


Quickly deploy an OS and dynamic list of applications to a device from a SharePoint request with MDT, Configuration Manager 2012, and System Center Orchestrator.


Solution Guide

What It Does

This example solution simplifies the installation of a custom list of applications onto a new computer during the imaging process. It provides an automated way to dynamically deploy applications during a System Center Configuration Manager 2012 OS deployment task sequence, with the list of applications being fed from a simple SharePoint list item. This approach allows a new PC deployment to be defined in SharePoint, including a list of software to be installed.

During deployment, the technician performing the build need only enter the request ID and (optional) username, which is passed to a System Center Orchestrator runbook that coordinates the creation of a record in the Microsoft Deployment Toolkit 2013 (MDT 2013) database. This record is then used by a native MDT task sequence to perform OS imaging and dynamic application installation.

The list of applications that can be selected in a request comes straight from Configuration Manager 2012, courtesy of an Orchestrator runbook that syncs Applications to a corresponding SharePoint list.

Choose a list of applications to deploy in SharePoint request
Choose a list of applications to deploy in SharePoint request

 

Submitted request ID becomes reference for deployment
Submitted request ID becomes reference for deployment

 

Simple WinPE dialog to begin deployment with minimal data entry
Simple WinPE dialog to begin deployment with minimal data entry

 

Applications installed according to selections in SharePoint request
Applications installed according to selections in SharePoint request

 

Results and inventory data stored back to request from client
Results and inventory data stored back to request from client

 

Why Do This?

There are several good things about an integration like this:

How It Works

This example is an integration of:

There are enough moving parts here to be confusing. It may help to think of all this as doing a couple main things: first, we get a web request form for device deployment; second, it enables a task sequence client to receive applications dynamically without knowing anything about them.

Also, a picture might help:

Solution architecture - Integrate SharePoint, MDT, Configuration Manager 2012 using Orchestrator
Solution architecture - Integrate SharePoint, MDT, Configuration Manager 2012 using Orchestrator

 

SharePoint Software List

The first list in SharePoint is a simple list of applications that can be included in a deployment request. This list comes from Configuration Manager’s defined applications, which are populated into the SharePoint list by the Orchestrator runbook “Sync Application List”.

Device Deployment Request List

The second list in SharePoint holds deployment requests. In our example, a request only contains a list of applications to install, selected from the items in the Software list. It has additional fields for other information including computer name, status, and inventory data, all of which is populated by Orchestrator during deployment.

When a new request is created, it is assigned an ID number automatically by SharePoint. This becomes the Deployment ID that is referenced during the deployment process.

Microsoft Deployment Toolkit

MDT 2013 is leveraged for the nifty things it does, most importantly as a database that can be queried by a task sequence client to get information about how to build itself, including its hostname and list of applications to install. This functionality is facilitated by several Orchestrator runbooks that create an MDT record with this information. Then the client comes along and receives the details from its usual queries during the remainder of the task sequence. You can view the records created by Orchestrator using the MDT Deployment Workbench under Database > Computers.

Orchestrator automates MDT record creation from SharePoint request item
Orchestrator automates MDT record creation from SharePoint request item

 

Everything described is out of box MDT functionality and can be configured using the provided features and tools. The necessary components are described in the implementation section below.

Configuration Manager 2012

Configuration Manager provides the operating system deployment capability and the task sequence (based on MDT additions) that is run on the client being deployed. As for MDT, nothing is special or customized here beyond the normal OSD setup, where you provide a task sequence to clients that boot either via PXE or boot media, where the task sequence performs the imaging of the OS and application installation from a Configuration Manager distribution point.

Aside from the task sequence itself, the only other item needed in Configuration Manager is a query that returns a list of applications. This query is then used by Orchestrator to sync the application list to SharePoint for selection in requests. The query is defined in the implementation steps below.

System Center Orchestrator 2012

Orchestrator interfaces between the components of the process. On an ongoing basis, it synchronizes the software list in SharePoint to provide current selections in the deployment request form. On a triggered basis, it acts on behalf of a deploying task sequence client to validate a request by ID, generate a unique hostname in the Active Directory domain, and create an MDT record to facilitate the deployment. It also accepts status updates from the client and records those in the request for viewing in SharePoint. Each of the runbooks is described in the Runbook Details section below.

Implementing In Your Environment

To test this in your lab, follow the yellow brick road here described.

Prerequisites

To get started, ensure the following are available:

Orchestrator Configuration

First, we will import the runbooks and configure the environment.

Orchestrator Runbook Import

The download files contain an ois_export file that can be used to import all the runbooks in the example. Use the import feature in Runbook Designer to import the runbooks. Uncheck the option to “Overwrite existing global configurations”, and leave all other import options at default to ensure everything is created correctly. Note: ensure all prerequisite integration packs listed above are installed before importing. And, always back up your database before importing if you want a clean roll-back option.

Import runbooks using standard method in Runbook Designer
Import runbooks using standard method in Runbook Designer

 

Once the import process finishes, you should see the following in Runbook Designer:

If you see runbook activities with a question mark icon, this means the required integration packs weren’t installed prior to import. You’ll want to delete what you imported or roll back the database, then install the integration packs before importing again.

Orchestrator Variable Configuration

Once the import finishes, several variables will be created under Global Settings > Variables > Automys Library > OS Deployment with Dynamic Application Installation. Update the values to reflect your environment. The purpose of each variable is explained in its description.

Orchestrator variables control runbook configuration
Orchestrator variables control runbook configuration

 

Orchestrator Integration Configuration

By default, the runbook import will bring in a global configuration for each of the integrations: Active Directory, SC 2012 Configuration Manager, and Microsoft SharePoint. To use these entries, update them with details for your environment. Alternatively, you can update each activity to use an existing configuration. The configurations are found in Runbook Designer under the Options menu.

Configuring Orchestrator integrations
Configuring Orchestrator integrations

 

Runbook Permissions

Since the task sequence will be asking Orchestrator to execute runbooks, it will need to have permission to do so. This is accomplished by granting runbook permission to the Configuration Manager Network Access Account, which is used by the task sequence.

Granting the task sequence client access to execute runbooks in Orchestrator
Granting the task sequence client access to execute runbooks in Orchestrator

 

MDT 2013 Installation

There are many installation guides for MDT available on the web via a quick search. Microsoft also provides downloadable documentation including a “Quick Start Guide for Microsoft System Center 2012 R2 Configuration Manager” that gives a procedure for installing MDT and integrating it with Configuration Manager. We won’t cover the details of the installation process here. For our purposes, note the following:

Deployment Share

A deployment share must be created, but without need for any additional configuration aside from the database under Advanced Configuration, which is covered next.

MDT Deployment Share

MDT Database

Under the Advanced Configuration of your MDT deployment share, you’ll need to have a database. When creating the database, define a SQL Share, which will allow integrated authentication from the task sequence in Windows PE. If you don’t configure the SQL Share, you’ll have to include a username and password in the CustomSettings.ini file in clear text to allow authentication to the database.

After the database is created, make sure it is accessible to both the task sequence clients and to Orchestrator. Required permissions are configured as follows under <database> \ Users \ (Properties) \ Membership:

Granting access to MDT database for task sequence client and Orchestrator
Granting access to MDT database for task sequence client and Orchestrator

MDT and Configuration Manager Integration

The MDT installation provides a “Configure ConfigMgr Integration” utility that integrates MDT into Configuration Manager. This allows using extra items in task sequences, like the ability to invoke Orchestrator runbooks. See for example this guide on the integration setup. If successful, you will see an option to “Create MDT Task Sequence” in the Configuration Manager console when viewing the task sequences section.

MDT Toolkit Package Creation

When the client runs MDT actions in a task sequence, it will need to make use of the MDT files. This is done through a package with the toolkit contents, which can be created most easily by using the Create MDT Task Sequence wizard. Use the step “MDT Package” to specify where to create a new package. Then, this package can be used in the example task sequence imported later. The task sequence created during this wizard isn’t intended for use and can be deleted after the wizard finishes. Ensure you run the Distribute Content wizard to distribute the package files to a distribution point.

Creating MDT Toolkit package using wizard
Creating MDT Toolkit package using wizard

MDT Settings Package

The task sequence is able to query the MDT database using rules defined in the file CustomSettings.ini. This file must be included in a Configuration Manager package and referenced in the “Gather” task sequence steps. You can create this package in the same wizard shown above, within the “Settings Package” step. Once the package is created, ensure you run the Distribute Content wizard to copy the package files to a distribution point.

Creating MDT settings package using wizard
Creating MDT settings package using wizard

 

Deployment Log Share

An MDT task sequence can copy all deployment logs to a shared folder upon completion or failure. This is a very nice feature for troubleshooting task sequence problems, and is highly recommended. You enable this by creating a share on the network accessible to the task sequence client running under the Configuration Manager Network Access Account credentials, allowing permissions to write to it, and setting the SLShare property in CustomSettings.ini. The path to the logs will be populated into the SharePoint request as a hyperlink, allowing one-click access to all the deployment logs including SMSTS.log and the MDT script logs.

Configuration Manager Setup

Configuration Manager should be set up to perform OS deployments (OSD). For the purposes of this example I’ll assume that you already have Configuration Manager OSD working, including a boot image and OS image. This example extends the existing capability. Assuming MDT and SCCM have been integrated as described above, we’ll need to import and configure the example task sequence, import or create the UI++ package, and create a query. These are described next.

Import UI++ Package

UI++ provides our user interface in the task sequence. This is delivered to the client as a package which includes several files including the UI++ executable and XML configuration files. These have been provided (with the exception of the UI++ executable) in the example download as the package export, which can be imported using the Configuration Manager console under Software Library > Application Management > Packages. To ensure you have the latest version, please download UI++ separately using the link in the steps below. Optionally, you can also create the package directly, using the included files as reference.

Extracted UI++ package files  Importing the UI++ package into Configuration Manager

 

Copy the latest UI++ executable into the package source folder
Copy the latest UI++ executable into the package source folder

 

UI++ package imported into Configuration Manager

 

Task Sequence Setup

The solution download contains the task sequence used in the example. It can be imported in the same way as packages.

Importing example task sequence into Configuration Manager 2012
Importing example task sequence into Configuration Manager 2012

 

After completing the import, the task sequence should be listed. Now, it must be configured to fix any missing references to packages and credentials.

Fixing broken references in imported task sequence
Fixing broken references in imported task sequence

 

Configure “Execute Runbook” from Task Sequence

The task sequence client invokes Orchestrator runbooks using MDT > Execute Runbook task sequence steps. These must be configured to point to the Orchestrator server in your environment. Unfortunately, the act of updating your server address will cause the step’s configuration to be reset. The easiest way to make the updates while ensuring correct configuration is to make a copy of the step and then update the copy. Then, delete the original. To do this for a given Execute Runbook step:

Copying a task sequence step to update configuration
Copying a task sequence step to update configuration

 

Copy the step configuration from the original to copy
Copy the step configuration from the original to copy

 

 

Steps to update

You’ll need to perform the above for each of the execute runbook steps in the task sequence. These are:

Deploy Task Sequence

Finally, we need to deploy the task sequence to allow it to be run by clients. This can vary depending on your environment, but is the same as deploying any other OSD task sequence. For example, use the Deploy Software wizard to make the task sequence available to media and PXE clients. A deployment targeting the “All Systems” collection with all default selections should work for testing purposes.

Deploying the task sequence

 

Application Query Creation

Orchestrator performs synchronization of the applications in Configuration Manager to SharePoint by leveraging a query. We need to create that query. Here’s how:

Importing query MOF file into Configuration Manager
Importing query MOF file into Configuration Manager

 

Once imported, you can test the query by selecting it and clicking Run from the ribbon. The result list of all application names should be displayed.

Results of imported All Applications query

 

Orchestrator Administrative User

To run the query, Orchestrator will need to connect to Configuration Manager as a recognized user. In my testing, setting up the Orchestrator runbook server account as a Read Only Analyst works fine. Do this under Administration in the Configuration Manager console.

Granting access for Orchestrator to Configuration Manager
Granting access for Orchestrator to Configuration Manager

 

Application Configuration

Applications should be created using normal method in Configuration Manager 2012. For new and existing applications to dynamically deploy, make sure to enable the option “Allow this application to be installed from the Install Application task sequence action without being deployed”, otherwise you’ll see this error recorded in smsts.log during the task sequence execution:

App policy for '<Application Name>' not received. Make sure the application is marked for dynamic app install

 

Set Configuration Manager application for dynamic deployment
Set Configuration Manager application for dynamic deployment

 

SharePoint List Creation

Finally, we need to create our lists in SharePoint. There will be one for Software and another for Deployment Requests. These are provided in the download files as list templates (.stp files).

Follow these steps to use the template files to create the lists. Tested on SharePoint 2010. Perform for both files.

  1. Open Site Actions > Site Settings.

  2. Select List templates under the Galleries section.

  3. Ensure the Documents tab of the Library Tools ribbon is visible.

  4. Click Upload Document, and upload the .stp file included in the downloaded example files.

  5. Once saved, open the All Site Content view.

  6. Click Create, and select Device Deployment Requests Template or Software List Template.

  7. Give the new list a name. Click Create.

  8. The list is created. Verify a new item can be created and saved.

Upon import, the lists should be displayed in the site content:

Imported SharePoint lists from templates
Imported SharePoint lists from templates

 

OK, that should be all the setup. Now for the fun stuff.

Testing

With all that excitement out of the way, now we’re ready to test. The first thing we’ll do is populate our software list, then create a new deployment request, and finally kick off the deployment with the deployment ID.

Populating the Software List

To get the applications from Configuration Manager into SharePoint, start the runbook “Sync Application List” from Runbook Designer. This will run immediately and every hour afterwards. After a few moments, it should finish its first run and create the items in SharePoint. Check the list to see if this is true, and if not, inspect the runbook logs for more information.

List of applications in SharePoint populated from Configuration Manager 2012
List of applications in SharePoint populated from Configuration Manager 2012

 

Creating a Deployment Request

Assuming the applications are populated, we can now create a deployment request. Simply select Add new item in the Device Deployment Requests list. Then add one or more applications as Software to Install. Leave the remaining fields empty, and save. Note the ID of the resulting item.

SharePoint deployment request

 

Running a Deployment

With deployment ID in hand, fire up the client device using boot media or PXE as normal (I recommend using a virtual machine for this to allow easy roll back to a snapshot before changes are made). If the task sequence deployment was correct, you should be able to select the example sequence “Deploy Windows 8 - MDT Orchestrator” from the list and continue. After some formatting and downloading package files, you should see the “Deployment Wizard” UI++ dialog appear, asking for ID and username. Fill these in and click the green button or press enter, and the deployment should proceed from there.

Deployment wizard in WinPE

 

When deployment completes, close the summary and log in, checking whether everything looks right, including installed applications. If anything is missing, all logs for troubleshooting should have been copied to the “SLShare” defined in the CustomSettings.ini file if that was created. A link is populated in the original request:

Deployment results populated into the original request, including SLShare path to logs

 

Please let us know how you fare in the comments below. Enjoy!

Taking it Further

This is a fairly simple example considering all the other things that could be done by extending it. For example, one could also:

If you’re interested in help with a project like this or otherwise, we do that.

 

Discuss