Controlling Package Sequence with Multiple Roles in MDT 2008

The Microsoft Deployment Toolkit allows you to assign a “sequence” to package/programs within a role. However, what if you have 3 different Computer Roles and want to preserve an order within them? For instance say you have the following computer based roles assigned to the same computer: Everyone, HR, Finance like such:

clip_image002

and want to order the installed packages in this order: First install packages for Everyone, then the packages for HR and finally the packages for Finance like this:

Order

Package

Sequence in Role

Role

001 Program 1 1 Everyone
002 Program 2 2 Everyone
003 Program 3 3 Everyone
004 Program 4 1 HR
005 Program 5 2 HR
006 Program 6 3 HR
007 Program 7 1 Finance
008 Program 8 2 Finance
009 Program 9 3 Finance

Table 1

The default queries in CustomSettings.ini will not do this. Instead, MDT will install the all the first packages from each role, then the second packages , then the third perhaps something like this:

Order

Package

Sequence in Role

Role

001 Program 1 1 Everyone
002 Program 4 1 HR
003 Program 7 1 Finance
004 Program 2 2 Everyone
005 Program 5 2 HR
006 Program 8 2 Finance
007 Program 3 3 Everyone
008 Program 6 3 HR
009 Program 9 3 Finance

Table 2

In fact, the order of each sequence 1 package is also not guaranteed. This means that you have no control whether the sequence 1 packages from the Everyone role precede the sequence 1 packages from the HR or Finance roles.

To achieve the result in Table 1, you’ll need to add joins to your CustomSettings query. It turns out that MDT does in fact have a field called “Sequence” that denotes the order of the Computer Role that corresponds to the order you add it to the workbench. In our above example, Everyone is sequence 1, HR is sequence 2 and Finance is sequence 3. The sequence is unique to each computer, so you will have to query also for the computer either by serial number, UUID, Asset Tag or Mac Address.

Add the following query instead of RPackages to order the list of packages in their role sequence order:

[CRPackages]

SQLServer=<SQLServerName>

Database=<MDT Database Name>

Netlib=DBNMPNTW

SQLShare=<SQL Authentication Share>

Table=dbo.Settings_Packages AS sp INNER JOIN dbo.RoleIdentity AS ri ON sp.ID = ri.ID INNER JOIN dbo.Settings_Roles AS sr ON sr.Role = ri.Role INNER JOIN dbo.computerRoles AS cr ON ri.Role = cr.Role and sr.ID = cr.ID

Parameters=UUID, AssetTag, SerialNumber, MacAddress

ParameterCondition=OR

Order=sr.Sequence, sp.Sequence

The trick here is to order by the Sequence property in the Settings_Packages table as well as the Sequence property in the Settings_Roles table. The latter Sequence property is the order you give to your computer roles in the workbench.

You can do similar things for ordering Packages for Location Roles and Make/Model Roles. The following is for ordered Make/Model Roles Packages:

[MRPackages]

SQLServer=<SQLServerName>

Database=<MDT Database Name>

Netlib=DBNMPNTW

SQLShare=<SQL Authentication Share>

Table=dbo.Settings_Packages AS sp INNER JOIN dbo.RoleIdentity AS ri ON sp.ID = ri.ID INNER JOIN dbo.Settings_Roles AS sr ON sr.Role = ri.Role INNER JOIN dbo.MakeModelRoles AS mr ON ri.Role = mr.Role and sr.ID = mr.ID

Parameters=Make, Model

Order=sr.Sequence, sp.Sequence

You can then order the different types of role packages (i.e. Computer, Make Model or Location Role packages) in the Priority Field:

Priority= MRPackages, LRPackages, CRPackages

This can be useful if you want to ensure that BIOS updates get installed first as part of a Make Model Role, then Localized application packages in a Location role and finally the Everyone, HR or Finance Computer Role packages.

Technorati Tags: Microsoft Deployment,Tips and Tricks

This post was contributed by Aly Shivji a consultant with Microsoft Services - U.S. East Region.