Microsoft Deployment Toolkit Samples Guide
Microsoft Deployment Toolkit Samples Guide
Microsoft Deployment Toolkit Samples Guide
Toolkit 2013
Microsoft Deployment Toolkit Samples Guide
The information in this document and any document referenced herein is provided for informational purposes
only, is provided AS IS AND WITH ALL FAULTS and cannot be understood as substituting for customized
service and information that might be developed by Microsoft Corporation for a particular user based upon that
users particular environment. RELIANCE UPON THIS DOCUMENT AND ANY DOCUMENT REFERENCED
HEREIN IS AT THE USERS OWN RISK.
2013 Microsoft Corporation. All rights reserved.
If the user of this work is using the work SOLELY FOR NON-COMMERCIAL PURPOSES INTERNALLY
WITHIN A COMPANY OR ORGANIZATION, then this work is licensed under the Creative Commons AttributionNonCommercial License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5 or
send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
MICROSOFT CORPORATION PROVIDES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO
THE INFORMATION CONTAINED IN THIS DOCUMENT AND ANY DOCUMENT REFERENCED HEREIN.
Microsoft Corporation provides no warranty and makes no representation that the information provided in this
document or any document referenced herein is suitable or appropriate for any situation, and Microsoft
Corporation cannot be held liable for any claim or damage of any kind that users of this document or any
document referenced herein may suffer. Your retention of and/or use of this document and/or any document
referenced herein constitutes your acceptance of these terms and conditions. If you do not accept these terms
and conditions, Microsoft Corporation does not provide you with any right to use any part of this document or
any document referenced herein.
Complying with the applicable copyright laws is the responsibility of the user. Without limiting the rights under
copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording or otherwise), or for
any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights or other intellectual property rights
covering subject matter within this document. Except as provided in any separate written license agreement
from Microsoft, the furnishing of this document does not give you, the user, any license to these patents,
trademarks, copyrights or other intellectual property.
Information in this document, including URL and other Internet Web site references, is subject to change without
notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail
addresses, logos, people, places and events depicted herein are fictitious, and no association with any real
company, organization, product, domain name, e-mail address, logo, person, place or event is intended or
should be inferred.
Microsoft, Active Directory, SQL Server, Visual Basic, Windows, Windows Live, Windows PowerShell, Windows
Server, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their respective
owners.
Contents
Introduction to the Microsoft Deployment Toolkit Samples Guide..............................................
Deploying Windows 8 Applications Using MDT............................................................................
Deploying Windows 8 Applications Using LTI..............................................................................
Deploying Windows 8 Applications Using UDI............................................................................
Managing MDT Using Windows PowerShell..................................................................................
Loading the MDT Windows PowerShell Snap-In.........................................................................
Load the MDT Windows PowerShell Snap-In Using the Import System Modules
Task......................................................................................................................................
Load the MDT Windows PowerShell Snap-In Using the Add-PSSnapIn Cmdlet.................
Creating a Deployment Share Using Windows PowerShell........................................................
Microsoft Deployment Toolkit
microsoft.com/mdt
Guide Title
microsoft.com/mdt
microsoft.com/mdt
Guide Title
microsoft.com/mdt
microsoft.com/mdt
Guide Title
Guide
microsoft.com/mdt
Ensure that you copy the Windows 8 application .appx file and any
other required files, such as a .cer file that contains the application
certificate.
3. Create an LTI application item for the Windows 8 application in the
Applications node in the Deployment Workbench using the New Application
Wizard.
4. Select the LTI application item created in the previous step in an LTI task
sequence.
microsoft.com/mdt
Guide Title
Ensure that you copy the Windows 8 application .appx file and any
other required files, such as a .cer file that contains the application
certificate.
3. Add the Windows 8 application as a Configuration Manager application
4. Create a Configuration Manager application item for the Windows 8
application using the Create Application Wizard in the Configuration Manager
console.
5. Ensure that the user device affinity (UDA) feature in Configuration Manager is
configured properly to support affinity between users and devices for
Configuration Manager application deployment.
microsoft.com/mdt
microsoft.com/mdt
Guide Title
11
Load the MDT Windows PowerShell snap-in using the Window PowerShell
Modules console as described in Load the MDT Windows PowerShell SnapIn Using the Import System Modules Task.
Load the MDT Windows PowerShell snap-in using the Add-PSSnapIn cmdlet
as described in Load the MDT Windows PowerShell Snap-In Using the AddPSSnapIn Cmdlet.
microsoft.com/mdt
You can start a Windows PowerShell console with the Import System
Modules task by performing one of the following procedures:
In the taskbar, right-click the Windows PowerShell icon, and then click
Import System Modules.
Load the MDT Windows PowerShell Snap-In Using the AddPSSnapIn Cmdlet
You can load the MDT Windows PowerShell snap-in
Microsoft.BDD.PSSnapInfrom any Windows PowerShell environment
using the Add-PSSnapIn cmdlet, as show in the following example:
Add-PSSnapin -Name Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Guide Title
13
The call to the win32_share class returns the results of the call. If the
value of ReturnValue is zero (0), then the call was successful.
4. Specify the new shared folder as a deployment share using the New-PSDrive
cmdlet, as shown in the following example:
New-PSDrive -Name "DS002" -PSProvider "MDTProvider" -Root
"C:\MDTDeploymentShare$" -Description "MDT Deployment Share Created
with Cmdlets" -NetworkPath "\\WDG-MDT-01\MDTDeploymentShare$"
-Verbose
5. Verify that the appropriate deployment share folders have been created using
the dir command, as show in the following example:
dir ds002:
microsoft.com/mdt
6. Add the new deployment share to the list of persisted MDT deployment
shares using the Add-MDTPersistentDrive cmdlet, as shown in the following
example:
$NewDS=Get-PSDrive "DS002"
Add-MDTPersistentDrive -Name "DS002" -InputObject $NewDS -Verbose
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Guide Title
15
The list of Windows PowerShell drives that are provided using the
MDTProvider are listed.
4. View the properties of the deployment share using the Get-ItemProperty
cmdlet, as shown in the following example:
Get-ItemProperty "DS002:"
3. View the list of MDT deployments that share Windows PowerShell drives, one
for each deployment share, using the Get-PSDrive cmdlet, as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Guide Title
17
the original deployment share to the linked deployment share. You can
perform the same process using the Deployment Workbench, as
described in "Replicate Linked Deployment Shares in the Deployment
Workbench".
To update a linked deployment share using Windows PowerShell
1. Load the MDT Windows PowerShell snap-in as described in Loading the
MDT Windows PowerShell Snap-In.
2. Ensure that the MDT deployments that share Windows PowerShell drives are
restored using the Restore-MDTPersistentDrive cmdlet, as shown in the
following example:
Restore-MDTPersistentDrive -Verbose
Note If the MDT deployments that share Windows PowerShell drives are already restored,
you will receive a warning message indicating that the cmdlet is unable to restore the drive.
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
An .iso file in the media_folder folder (where media_folder is the name of the
folder that you specified for the media)
Selecting the Generate a Lite Touch bootable ISO image check box on
the General tab of the media Properties dialog box (Clear this check box
to reduce the time needed to generate the media unless you need to
create bootable DVDs or start virtual machines [VMs] from the .iso file.)
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Guide Title
19
Note Updating the linked deployment share can take a long time. The progress of the cmdlet
is shown at the top of the Windows PowerShell console.
Description
Import-MDTApplication
Import-MDTDriver
Import-MDTOperatingSystem
microsoft.com/mdt
Cmdlet
Description
systems into a deployment share
Import-MDTPackage
Import-MDTTaskSequence
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as shown in the following
example:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Guide Title
21
5. View the properties of one of the items listed in the previous step using the
Get-ItemProperty cmdlet, as shown in the following example:
Get-ItemProperty -Path "DS002:\Operating Systems\Windows 8 in Windows
8 x64 install.wim"
In this example, the value of the Path parameter is the fully qualified
Windows PowerShell path to the item, including the file name that was
returned in the previous step. You could use the same process to view
the properties of other types of items, such as device drivers or
applications.
microsoft.com/mdt
Restore-MDTPersistentDrive -Verbose
Note If the MDT deployments that share Windows PowerShell drives are already restored,
you will receive a warning message indicating that the cmdlet is unable to restore the drive.
3. Verify that the MDT deployments that share Windows PowerShell drives are
restored properly using the Get-PSDrive cmdlet, as shown in the following
example:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
5. Remove one of the items listed in the previous step using the Remove-Item
cmdlet, as shown in the following example:
Remove-Item -Path "DS002:\Operating Systems\Windows 8 in Windows 8
x64 install.wim"
In this example, the value of the Path parameter is the fully qualified
Windows PowerShell path to the item, including the file name that was
returned in the previous step.
You could use the same process to remove other types of items, such
as device drivers or applications.
Note Removing an item that a task sequence uses causes the task sequence to fail. Ensure
that an item is not referenced by other items in the deployment share prior to removing the
item.
microsoft.com/mdt
Guide Title
23
For more information about how to create a .csv file for use with the
Import-CSV cmdlet, see Using the Import-Csv Cmdlet.
Microsoft Deployment Toolkit
microsoft.com/mdt
2. Create a Windows PowerShell script file that will be used to automate the
population of the deployment share.
For more information on the Import-CSV cmdlet, see Using the ImportCsv Cmdlet.
5. Create a ForEach-Object cmdlet loop that processes each item from the .csv
file referenced in the Import-CSV cmdlet in the previous step.
For more information on the MDT cmdlets used for importing items into
a deployment share, see Import an Item into a Deployment Share.
microsoft.com/mdt
Guide Title
25
3. View the list of MDT deployments that share Windows PowerShell drives, one
for each deployment share, using the Get-PSDrive cmdlet as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
The Windows_8 folder and any other existing folders in the Operating
Systems folder is displayed.
6. Create a folder named Windows_7 folder in the Operating Systems folder in a
deployment share using the New-Item cmdlet, as shown in the following
example and described in Using the New-Item Cmdlet:
New-Item "DS002:\Operating Systems\Windows_7" -Type directory
The Windows_7 folder and any other existing folders in the Operating
Systems folder is displayed.
microsoft.com/mdt
3. View the list of MDT deployments that share Windows PowerShell drives, one
for each deployment share, using the Get-PSDrive cmdlet as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Guide Title
27
3. View the list of MDT deployments share Windows PowerShell drives, one for
each deployment share, using the Get-PSDrive cmdlet as follows:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
7. Verify that the folder is created correctly by typing the following command:
dir "DS002:\Operating Systems"
Copying updated source content that already contains the service pack (for
example, Windows 7 with SP1 media) to the folder in the deployment share in
which the existing operating system resides, as described in Automating the
Application of Operating System Service Packs from Updated Source Media
microsoft.com/mdt
Guide Title
29
For this method, the operating system source media with the service pack
is copied over the existing operating system files without the service pack
in the deployment share using Windows PowerShell.
To automate the application of operating system service packs from
updates source media using Windows PowerShell
1. Load the MDT Windows PowerShell snap-in as described in Loading the
MDT Windows PowerShell Snap-In.
2. Ensure that the MDT deployments that share Windows PowerShell drives are
restored using the Restore-MDTPersistentDrive cmdlet, as shown in the
following example:
Restore-MDTPersistentDrive -Verbose
Note If the MDT deployments that share Windows PowerShell drives are already restored,
you will receive a warning message indicating that the cmdlet is unable to restore the drive.
3. View the list of MDT deployments share Windows PowerShell drives, one for
each deployment share, using the Get-PSDrive cmdlet, as shown in the
following example:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
In this example, the operating system source files are on drive E, and
DS002: is the name of a Windows PowerShell drive returned in step 3.
6. Update any MDT deployment media based on deployment share using
Update-MDTMedia cmdlet.
microsoft.com/mdt
For more information about how to update MDT deployment media based
on deployment share using Update-MDTMedia cmdlet, see Updating
Deployment Media Using Windows PowerShell.
For more information on how to install the service pack, see the
documentation accompanying the service pack.
3. Capture an image of the reference computer by creating and deploying a task
sequence based on the Sysprep and Capture task sequence template.
microsoft.com/mdt
Guide Title
31
6. View the list of MDT deployments share Windows PowerShell drives, one for
each deployment share, using the Get-PSDrive cmdlet, as shown in the
following example:
Get-PSDrive -PSProvider Microsoft.BDD.PSSnapIn\MDTProvider
microsoft.com/mdt
Note In earlier versions of the Deployment Workbench, the IsServer flag indicated that the
existing operating system is a server operating system (such as Windows Server 2003 Enterprise
Edition). This flag has been renamed to IsServerOS.
microsoft.com/mdt
Guide Title
33
.
.
[Laptop-False]
.
.
.
[Desktop-True]
.
.
.
[Desktop-False]
.
.
.
[Server-True]
.
.
.
[Server-False]
.
.
.
microsoft.com/mdt
In Listing 2, the inserted row connects any computer that has the entry
Office12.0 with the Microsoft Office 2010 Professional Plus package.
This means that Microsoft Office 2010 Professional Plus will be
installed on any computer currently running the 2007 Microsoft Office
system (Office 12.0). Add similar entries for any other packages. Any
item for which there is no entry is ignored (no package will be
installed).
3. Create a stored procedure to simplify joining the information in the new table
with the inventory data (as illustrated in Listing 3).
Listing 3. SQL Query to Create a Stored Procedure to Simplify Joining the
Information with Inventory Data
use [MDTDB]
go
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].
[RetrievePackages]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[RetrievePackages]
go
microsoft.com/mdt
Guide Title
35
microsoft.com/mdt
The actual value of the MACAddress custom key will be substituted for
the corresponding ? in Listing 7. This query returns a record set with the
rows entered in step 2.
A variable number of arguments cannot be passed to a stored procedure.
As a result, when a computer has more than one MAC address, not all
MAC addresses can be passed to the stored procedure. As an alternative,
replace the stored procedure with a view that allows querying the view
microsoft.com/mdt
Guide Title
37
with a SELECT statement with an IN clause to pass all the MAC address
values.
Based on the scenario presented here, if the current computer has the
value Office12.0 inserted into the table (step 2), the one row is returned
(XXX0000F:Install Office 2010 Professional Plus). This indicates that package
XXX0000F:Install Office 2001 Professional Plus will be installed by the
ZTI process during the State Restore Phase.
SkipAdminPassword
SkipApplications
SkipBDDWelcome
SkipBitLocker
SkipBitLockerDetails
SkipTaskSequence
SkipCapture
SkipComputerBackup
SkipComputerName
SkipDomainMembership
SkipFinalSummary
SkipLocaleSelection
microsoft.com/mdt
SkipPackageDisplay
SkipProductKey
SkipSummary
SkipTimeZone
SkipUserData
microsoft.com/mdt
Guide Title
39
SkipDomainMembership=YES
JoinDomain=DomainName
DomainAdmin=Administrator
DomainAdminDomain=DomainName
DomainAdminPassword=a_secure_password
SkipUserData=yes
UserDataLocation=AUTO
UDShare=\\Servername\Sharename\Directory
UDDir=%ComputerName%
SkipComputerBackup=YES
ComputerBackuplocation=AUTO
BackupShare=\\Servername\Backupsharename
BackupDir=%ComputerName%
SkipTaskSequence=YES
TaskSequenceID=Enterprise
SkipComputerName=YES
OSDComputerName=%ComputerName%
SkipPackageDisplay=YES
LanguagePacks001={3af4e3ce-8122-41a2-9cf9-892145521660}
LanguagePacks002={84fc70d4-db4b-40dc-a660-d546a50bf226}
SkipLocaleSelection=YES
UILanguage=en-US
UserLocale=en-CA
KeyboardLocale=0409:00000409
SkipTimeZone=YES
TimeZoneName=China Standard Time
SkipApplications=YES
Applications001={a26c6358-8db9-4615-90ff-d4511dc2feff}
Applications002={7e9d10a0-42ef-4a0a-9ee2-90eb2f4e4b98}
UserID=Administrator
UserDomain=DomainName
UserPassword=P@ssw0rd
microsoft.com/mdt
SkipBitLocker=YES
SkipSummary=YES
Powerusers001=DomainName\Username
SkipCapture=YES
ComputerBackupLocation=\\WDG-MDT-01\Backup$\
BackupFile=MyCustomImage.wim
SkipAdminPassword=YES
SkipProductKey=YES
SkipDomainMembership=YES
JoinDomain=WOODGROVEBANK
DomainAdmin=Administrator
DomainAdminDomain=WOODGROVEBANK
DomainAdminPassword=P@ssw0rd
SkipUserData=Yes
UserDataLocation=\\WDG-MDT-01\UserData$\Directory\usmtdata
microsoft.com/mdt
Guide Title
41
SkipTaskSequence=YES
TaskSequenceID=Enterprise
SkipComputerName=YES
OSDComputerName=%SerialNumber%
SkipPackageDisplay=YES
LanguagePacks001={3af4e3ce-8122-41a2-9cf9-892145521660}
LanguagePacks002={84fc70d4-db4b-40dc-a660-d546a50bf226}
SkipLocaleSelection=YES
UILanguage=en-US
UserLocale=en-CA
KeyboardLocale=0409:00000409
SkipTimeZone=YES
TimeZoneName=China Standard Time
SkipApplications=YES
Applications001={a26c6358-8db9-4615-90ff-d4511dc2feff}
Applications002={7e9d10a0-42ef-4a0a-9ee2-90eb2f4e4b98}
SkipBitLocker=YES
SkipSummary=YES
Powerusers001=WOODGROVEBANK\PilarA
CaptureGroups=YES
SLShare=\\WDG-MDT-01\UserData$\Logs
Home_page=http://www.microsoft.com/NewComputer
microsoft.com/mdt
requests do not require any special security context and can use whatever
TCP/IP port is needed to simplify firewall configurations.
Listing 10 shows how to configure CustomSettings.ini to call a particular
web service. In this scenario, the web service is chosen at random from
an Internet search. It takes a postal code as input and returns the city,
state, area code, and time zone (as a letter) for the specified postal code.
Listing 10. CustomSettings.ini File to Call a Particular Web Service
Scenario
[Settings]
Priority=Default, USZipService
Properties=USZip, City, State, Zip, Area_Code, Time_Zones
[Default]
USZip=98052
[USZipService]
WebService=http://www.webservicex.net/uszip.asmx/GetInfoByZIP
Parameters=USZip
microsoft.com/mdt
Guide Title
43
There are a few minor complications to watch for when running a web
service:
A POST request to the web service is recommended, so the web service call
must be able to support a POST.
Using the ZTIConnect.wsf script, you can connect to other servers and
access resources on them. The syntax for the ZTIConnect.wsf script is as
follows (where unc_path is a Universal Naming Convention [UNC] path to
connect to the server):
Cscript.exe %SCRIPTROOT%\ZTIConnect.wsf /uncpath:unc_path
microsoft.com/mdt
6. Complete the Properties tab of the new task using the information listed in
Table 3 (accept default values if none are specified), and then click Apply.
Table 3. Completing the Properties Tab of the New Task
In this box
Do this
Name
Description
Command
7. Complete the Options tab of the new task using the information listed in
Table 4 (accept default values if none are specified), and then click OK.
Table 4. Completing the Options Tab of the New Task
microsoft.com/mdt
Guide Title
45
In this box
Do this
Success codes
After adding the task that will run the ZTIConnect.wsf script, subsequent
tasks can access network resources on the server specified in the
/uncpath option of the ZTIConnect.wsf script.
microsoft.com/mdt
8. Add the [SetModel] section to the Priority settings in the [Settings] section.
9. Add a line to the ModelAlias section to refer to a user exit script that will
truncate the model name at the (.
10. Create an MMApplications database lookup where ModelAlias is equal to
Model.
11. Create a user exit script and place it in the same directory as the
CustomSettings.ini file to truncate the model name.
microsoft.com/mdt
Guide Title
47
LogTypeInfo
Else
SetModelAlias = oEnvironment.Item("Model")
oLogging.CreateEntry " USEREXIT - " & _
"ModelAlias has not been changed.", LogTypeInfo
End if
End Function
A registry setting
microsoft.com/mdt
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share/Task Sequences (where
deployment_share is the name of the deployment share to configure).
3. In the details pane, click task_sequence (where task_sequence is the name
of the task sequence to configure).
4. In the Actions pane, click Properties.
5. In the task_sequence Properties dialog box, on the Task Sequence tab,
click step (where step is the name of the task sequence step to configure),
and then click the Options tab.
On the Options tab of the task sequence step, perform the following
actions:
Add. Click this button to add a condition to the task sequence step.
Edit. Click this button to modify an existing condition in a task sequence step.
IF Statements in Conditions
All task sequence conditions include one or more IF statements. IF
statements are the foundation for creating conditional task sequence
steps. A task sequence step condition can include only one IF statement,
but multiple IF statements can be nested beneath the top-level IF
statement to create more complex conditions.
An IF statement can be based on the conditions listed in Table 5, which
are configured in the IF Statement Properties dialog box.
Table 5. Conditions Available in IF Statements
Condition
All conditions
Any conditions
None
microsoft.com/mdt
Guide Title
Condition
49
Complete the condition for running the task sequence step by adding
other criteria to the conditions (for example, task sequence variables or
values in a registry setting).
To add an IF statement condition to a task sequence step
1. On the step Option tab (where step is the name of the task sequence step to
configure), click Add, and then click If statement.
2. In the If Statement Properties dialog box, click condition (where condition
is one of the conditions listed in Table 5), and then click OK.
microsoft.com/mdt
microsoft.com/mdt
Guide Title
51
microsoft.com/mdt
5. In the Path box, type the path of the folder that contains the application.
6. Select the Check the timestamp check box.
7. Click Less than or equals for the condition.
8. In the Date box, click 12/31/2007.
9. In the Time box, click 12:00:00 AM, and then click OK.
microsoft.com/mdt
Guide Title
53
microsoft.com/mdt
6. Click OK.
Complex Conditions
Multiple conditions can be grouped using IF statements to create complex
conditions. For instance, imagine that a particular step should only be run
for Contoso 1950 computers running Windows Server 2003 or Windows
Server 2008. Written as a programmatic IF statement, it would look similar
to the following:
IF ((Computer Model IS Contoso 1950) AND (operating system=2003 OR
operating system=2008))
microsoft.com/mdt
Guide Title
55
12. In the Operating system box, click the operating system and version. For
this example, click x86 Windows 2008 original release. Click OK.
microsoft.com/mdt
Required component
Purpose/comment
MDT
DFS-R
Windows Deployment
Services
Purpose/comment
DFS-R
Windows Deployment
Services
Note Windows Deployment Services must be set up and configured on each child server, but it is
not necessary to add boot or installation images.
microsoft.com/mdt
Guide Title
57
Note Ensure that the LiteTouchPE_x86.wim file created when the deployment share is updated
has been added to Windows Deployment Services.
microsoft.com/mdt
In the Name for replication group box, type a name for the replication
groupfor example, MDT 2010 Replication Group.
Ensure that the Domain box contains the correct domain name.
7. Click Next.
8. On the Replication Group Members page, perform these steps:
a. Click Add.
b. Type the names of all servers that are to be members of this replication
groupfor example, all child deployment servers and the master
deployment server.
c. Click OK.
9. Click Next.
10. On the Topology Selection page, click Hub and Spoke, and then click
Next.
11. On the Hub Members page, click the master deployment server, and then
click Add.
12. Click Next.
13. On the Hub and Spoke Connections page, ensure that for each child
deployment server the master deployment server listed is the Required Hub
Member.
14. Click Next.
15. On the Replication Group Schedule and Bandwidth page, specify a
schedule for replicating the content between servers.
16. Click Next.
Microsoft Deployment Toolkit
microsoft.com/mdt
Guide Title
59
17. On the Primary Member page, in the Primary Member box, click the master
deployment server.
18. Click Next.
19. On the Folders to Replicate page, click Add, and then perform these steps:
a. In the Local Path of the folder to replicate box, click Browse to go to
the X:\Deployment folder (where X is the drive letter on the deployment
server).
b. Click Use name based on path.
c. Click OK.
d. Click Add.
e. In the Add Folder to Replicate dialog box, click Browse to go to the
X:\RemoteInstall\Boot folder.
f.
microsoft.com/mdt
Note Ensure that the new replication group is now listed beneath the Replication node.
2. Ensure that the SQL Server Browser service is enabled and set to Automatic.
3. In the SQL Server Surface Area Configuration box, click Local and
Remote connections.
microsoft.com/mdt
Guide Title
61
This terminology is used through the SQL Server replication setup and
configuration wizards.
microsoft.com/mdt
9. Click Next.
10. On the Agent Security page, click the account under which the snapshot
agent will run, and then click Next.
11. On the Wizard Actions page, click Create the publication, and then click
Next.
12. On the Complete the Wizard page, in the publication name box, type a
descriptive publication name.
13. Click Finish to complete the wizard, and then click Close when the wizard
has created the publication.
Note The publication will now be visible beneath the Local Publications node in SQL Server
Management Studio.
microsoft.com/mdt
Guide Title
63
7. Click Next.
8. On the Distribution Agent Security page, click to open the Distribution
Agent Security dialog box.
9. Type the details of the account to use for the distribution agent, and then click
Next.
10. On the Synchronization Schedule page, perform these steps:
a. In the Agent Schedule box, click <Define schedule>.
b. Specify the schedule that should be used to replicate the database
between master and child deployment servers, and then click Next.
11. On the Initialize Subscription page, click Next.
Microsoft Deployment Toolkit
microsoft.com/mdt
12. On the Wizard Actions page, click Create the subscription(s), and then
click Next.
13. Click Finish, and then click Close when the wizard has successfully finished.
Configure CustomSettings.ini
The LTI deployment infrastructure has now been successfully created,
and each location will contain an LTI deployment server, with a replicated
copy of:
The MDT DB
Now, you can configure the CustomSettings.ini file for the deployment
share to use the deployment content (deployment share and database)
from its local deployment server, the server that delivers the
LiteTouchPE_x86.wim environment through Windows Deployment
Services.
When the LiteTouchPE_x86.wim file is delivered from Windows
Deployment Services, a registry key is configured with the name of the
Windows Deployment Services server you are using. MDT captures this
server name in a variable (%WDSServer%) that you can use to configure
CustomSettings.ini.
To always use the local LTI deployment server
Note The following procedure assumes that the deployment share has been created and set as
the Deployment$ share.
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share (where
deployment_share is the name of the deployment share to configure).
3. In the Actions pane, click Properties.
microsoft.com/mdt
Guide Title
65
4. Click the Rules tab, and then modify the CustomSettings.ini file to configure
the following properties:
For each SQL Server section added, configure SQLServer to use the
server name %WDSServer%for example, SQLServer=%WDSServer
%.
microsoft.com/mdt
[CSettings]
SQLServer=%WDSServer%
Instance=
Database=MDTDB
Netlib=DBNMPNTW
SQLShare=
Table=ComputerSettings
Parameters=UUID, AssetTag, SerialNumber, MacAddress
ParameterCondition=OR
[CPackages]
SQLServer=%WDSServer%
Database=MDTDB
Netlib=DBNMPNTW
SQLShare=
Table=ComputerPackages
Parameters=UUID, AssetTag, SerialNumber, MacAddress
ParameterCondition=OR
Order=Sequence
[CApps]
SQLServer=%WDSServer%
Database=MDTDB
Netlib=DBNMPNTW
SQLShare=
Table=ComputerApplications
Parameters=UUID, AssetTag, SerialNumber, MacAddress
ParameterCondition=OR
Order=Sequence
[CAdmins]
SQLServer=%WDSServer%
Database=MDTDB
Netlib=DBNMPNTW
SQLShare=
Table=ComputerAdministrators
Parameters=UUID, AssetTag, SerialNumber, MacAddress
ParameterCondition=OR
[CRoles]
SQLServer=%WDSServer%
Database=MDTDB
Microsoft Deployment Toolkit
microsoft.com/mdt
Guide Title
67
Netlib=DBNMPNTW
SQLShare=
Table=ComputerRoles
Parameters=UUID, AssetTag, SerialNumber, MacAddress
ParameterCondition=OR
Understanding LocationServer.xml
First, you must understand How MDT uses LocationServer.xml. During
LTI, MDT scripts read and process the BootStrap.ini file to gather initial
information about the deployment. This happens before a connection has
been made to the deployment server. Therefore, the DeployRoot
property is commonly used to specify in the BootStrap.ini file the
deployment server to which it should make a connection.
Microsoft Deployment Toolkit
microsoft.com/mdt
Details
%WDSServer%
This method is used when the MDT server is cohosted on the Windows Deployment Services
server.
When an LTI deployment is initiated from
Windows Deployment Services, an environmental
variable%WDSServer%is created and
populated with the name of the Windows
Deployment Services server.
The DeployRoot variable can use this variable to
automatically connect to a deployment share on
the Windows Deployment Services serverfor
example:
DeployRoot=\\%WDSServer%\Deployment$
Location-based
automation
microsoft.com/mdt
Guide Title
Method
69
Details
For more information about using location-based
automation, refer to "Selecting the Methods for
Applying Configuration Settings".
Each approach listed in Table 8 offers one way to automate the selection
of the deployment server at a given location for certain scenarios. These
approaches are targeted to specific scenariosfor example, when the
MDT server is co-hosted with Windows Deployment Services.
There are other scenarios in which these approaches are not suitablefor
example, if there are multiple deployment servers at a given location or
automation logic is not possible (for example, the network is not
segmented enough to allow location determination or the MDT server is
separated from Windows Deployment Services).
In these scenarios, the LocationServer.xml file provides a flexible way to
present this information at deployment time without requiring knowledge
of server names and deployment share names.
A unique identifier
A location name, used to present an easily identifiable name for that location
microsoft.com/mdt
Using this format, specify different server entries for each location (as
shown in Listing 15) or for situations in which there are multiple servers
within a single location by specifying a different server entry for each
server at that location, as shown in Listing 16.
Listing 16. Example LocationServer.xml File to Support Multiple
Servers at Multiple Locations
<?xml version="1.0" encoding="utf-8" ?>
<servers>
<QueryDefault></QueryDefault>
<server>
<serverid>1</serverid>
<friendlyname>
Contoso HQ DS1, Seattle, USA
</friendlyname>
<UNCPath>\\STLDS01\Deployment$</UNCPath>
microsoft.com/mdt
Guide Title
71
</server>
<server>
<serverid>2</serverid>
<friendlyname>
Contoso HQ DS2, Seattle, USA
</friendlyname>
<UNCPath>\\STLDS02\Deployment$</UNCPath>
</server>
</servers>
microsoft.com/mdt
</friendlyname>
<UNCPath>\\NYCDS01\Deployment$</UNCPath>
</server>
</servers>
Specify the weighting metric by using the <server weight> tag, which MDT
uses in the server-selection process. The likelihood of a server being
selected is calculated by:
Server weight/sum of all server weights
In Listing 17, the three servers at Contoso HQ are listed as 1, 2, and 4.
The likelihood of a server with a weighting of 2 being selected becomes 2
in 7. Therefore, to use the weighting system, determine the capacity of the
servers available at a location, and weight each server by the servers
capacity in relation to each of the other servers.
microsoft.com/mdt
Guide Title
73
microsoft.com/mdt
microsoft.com/mdt
Guide Title
75
In this sample deployment, replace the existing computer (WDG-EXIST01) with a new computer (WDG-NEW-02) in the CORP domain by
capturing user state data from WDG-EXIST-01 and saving it to a network
share. Then, deploy an existing image to WDG-NEW-02, and finally
restore the captured user state data to WDG-NEW-02. The deployment
will be performed from a deployment server (WDG-MDT-01).
In MDT, use the Standard Client Replace Task Sequence template to
create a task sequence that will perform all the necessary deployment
tasks.
This demonstration assumes that:
MDT has been installed on the deployment server (WDG MDT 01)
The deployment share has already been created and populated, including
operating system images, applications, and device drivers
A deployment share should exist prior to beginning this sample. For more
information about creating a deployment share, see the section,
"Managing Deployment Shares in the Deployment Workbench", in the
MDT document Using the Microsoft Deployment Toolkit.
microsoft.com/mdt
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/ deployment_share/Task Sequences (where
deployment_share is the name of the deployment share to configure).
3. In the Actions pane, click New Task Sequence.
On this wizard
page
Do this
General Settings
Select Template
Summary
Confirmation
Click Finish.
The New Task Sequence Wizard finishes, and the VISTA_EXIST task
sequence is added to the list of task sequences.
microsoft.com/mdt
Guide Title
77
(deploying the operating system, and then restoring the user state on the
existing computer), select the Standard Client Task Sequence template in
the New Task Sequence Wizard.
To create a task sequence to deploy the user state in the Replace
Computer deployment scenario
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share/Task Sequences (where
deployment_share is the name of the deployment share to configure).
3. In the Actions pane, click New Task Sequence.
On this wizard
page
Do this
General Settings
Select Template
Select OS
microsoft.com/mdt
On this wizard
page
Do this
Workbench), and then click Next.
Specify Product
Key
OS Settings
Admin Password
Confirmation
Click Finish.
The New Task Sequence Wizard finishes, and the VISTA_NEW task
sequence is added to the list of task sequences.
microsoft.com/mdt
Guide Title
79
microsoft.com/mdt
microsoft.com/mdt
Guide Title
81
If the reference computer is a VM, start the VM directly from the ISO file
or from a CD or DVD of the ISO file.
microsoft.com/mdt
2. Complete the Windows Deployment Wizard using the information in Table 11.
Accept the default values unless otherwise specified.
Table 11. Information for Completing the Windows Deployment Wizard
On this wizard
page
Do this
Welcome to
Deployment
Specify
Credentials for
connecting to
network shares.
Select a task
sequence to
execute on this
computer.
Specify where to
save your data and
settings
Click Next.
Specify where to
save a complete
computer backup
Ready to begin
Click Begin.
microsoft.com/mdt
Guide Title
83
On this wizard
page
Do this
Welcome to
Deployment
Specify
Credentials for
connecting to
network shares.
Select a task
sequence to
execute on this
computer.
Configure the
computer name
microsoft.com/mdt
On this wizard
page
Do this
Click Next.
Specify whether to
restore user data
Locale Selection
Click Next.
Click Next.
Specify whether to
capture an image
Specify the
BitLocker
configuration
Ready to begin
Click Begin.
Windows Vista is now installed on the new computer and the captured
user state migration information is also restored.
microsoft.com/mdt
Guide Title
85
Logging. This class provides the logging functionality that all MDT scripts
use. It also creates a single log file for each script run during deployment and
a consolidated log file of all scripts. These log files are created in a format
designed to be read by TRACE32; this tool is available in the System Center
Configuration Manager 2007 Toolkit V2.
Utility. This class provides general utilities that are used throughout ZTI and
LTI scripts. Microsoft recommends that any time custom code is developed
this class should be examined to see if any code can simply be reused.
Additional information about some of the functionality provided in this class is
included later in this section.
microsoft.com/mdt
Strings. This class performs common string processing routines like creating
a delimited list of items, displaying a hex value, trimming white space from a
string, right aligning a string, left aligning a string, forcing a value to string
format, forcing a value to array format, generating a random globally unique
identifier (GUID), and Base64 conversions.
The overall structure of the MDT scripts has also changed. Most MDT
scripts are now encapsulated within VBScript Class objects. The class is
initialized and called with the RunNewInstance function.
Note Most existing MDT 2008 Update 1 scripts will work as-is in MDT, even with the extensive
changes to ZTIUtility.vbs, as most MDT scripts will include ZTIUtility.vbs.
microsoft.com/mdt
Guide Title
87
//*******************************************************
//
// Copyright (c) Microsoft Corporation. All rights reserved
// Microsoft Deployment Toolkit Solution Accelerator
// File: ZTI_Example.wsf
//
// Purpose: Example of scripting with the
//
Microsoft Deployment Toolkit.
//
// Usage: cscript ZTI_Example.wsf [/debug:true]
//
//*******************************************************
Option Explicit
RunNewInstance
'//-------------------------------------------------------'// Main Class
'//-------------------------------------------------------Class ZTI_Example
'//-------------------------------------------------------'// Main routine
'//-------------------------------------------------------Function Main()
microsoft.com/mdt
Dim iRetVal
Dim sScriptPath
iRetVal = SUCCESS
oLogging.CreateEntry "Begin example script", _
LogTypeInfo
' %ServerA% is a generic variable available within
' every CustomSettings.ini file.
sScriptPath = "\\" & oEnvironment.Item("ServerA") & _
"\public\products\Applications\User\Technet\USEnglish"
' Validate a connection to server, net connect with
' credentials if necessary.
iRetVal = oUtility.ValidateConnection( sScriptPath )
TestAndFail iRetVal, 9991, "Validate Connection to [" & _
sScriptPath & "]"
'Run Setup Program
iRetVal = oUtility.RunWithHeartbeat( """" & _
sScriptPath & "\setup.exe"" /?" )
TestAndFail iRetVal, 9991, "RunWithHeartbeat [" & _
sScriptPath & "]"
'Perform any cleanup from installation process
oShell.RegWrite "HKLM\Software\Microsoft\SomeValue", _
"Done with Execution of XXX.", "REG_SZ"
Main = iRetVal
End Function
End Class
</script>
</job>
Note If you want to continue using scripts that call ZTIProcess() with ProcessResults(), you can
continue to do so. However, certain enhanced error-handling features will not be enabled.
Microsoft Deployment Toolkit
microsoft.com/mdt
Guide Title
89
Output
oUtility.LocalRootPath
oUtility.BootDevice
oUtility.LogPath
oUtility.StatePath
oUtility.ScriptName
oUtility.ScriptDir
oUtility.ComputerNam
e
microsoft.com/mdt
Function
Output
oUtility.ReadIni(file,
section, item)
oUtility.WriteIni(file,
section, item, value)
oUtility.Sections(file)
oUtility.SectionConten
ts(file, section)
oUtility.RunWithHeartb
eat(sCmd)
oUtility.FindFile
(sFilename,sFoundPat
h)
oUtility.findMappedDri
ve(sServerUNC)
oUtility.ValidateConne
ction(sServerUNC)
MapNetworkDrive
(sShare, SDomID,
sDomPwd)
VerifyPathExists(strPa
th)
oEnvironment.Substit
ute(sVal)
oEnvironment.Item
(sName)
oEnvironment.Exists
(sName)
oEnvironment.ListItem
(sName)
Microsoft Deployment Toolkit
Guide Title
91
Function
Output
oLogging.ReportFailur
e
(sMessage, iError)
oLogging.CreateEvent
(iEventID, iType,
sMessage, arrParms)
oLogging.CreateEntry
(sLogMsg, iType)
TestAndFail(iRc,
iError, sMessage)
TestAndLog(iRc ,
sMessage)
The custom deployment code script name should always begin with the letter
Z.
The custom deployment code should be placed in the Scripts folder on the
deployment sharefor example, D:\Production Deployment Share\Scripts.
The most frequently used methods for integrating custom code that also
ensure consistent logging are:
microsoft.com/mdt
On this wizard
page
Do this
Application Type
Details
Command Details
Summary
Confirmation
Click Finish.
microsoft.com/mdt
Guide Title
93
The newly created task sequence step appears in the list of task
sequence steps.
microsoft.com/mdt
Device drivers that contain an .inf file that can be used to import the device
driver into the Deployment Workbench
Device drivers that are packaged as an application, and that must be installed
as an application
Using MDT, you can handle both types of drivers as part of an operating
system deployment.
Install device drivers by:
microsoft.com/mdt
Guide Title
95
As a package that you can extract and that contains .inf files used to import
the driver into the Deployment Workbench
Device driver packages that can be extracted to access .inf files can use
the MDT automatic driver detection and installation process by first
importing the driver into the Out-of-Box Drivers node in the Deployment
Workbench.
Device driver packages that cannot be extracted to isolate .inf files or
those that do not work correctly without first being installed using an
application installer such as an MSI or Setup.exe file can use the MDT
Install Application feature and install the device driver during the
deployment process just as for any normal application.
microsoft.com/mdt
5. On the Specify Directory page, in the Drive source directory section, click
Browse to go to the folder that contains the new device drivers, and then
click Next.
Note The New Device Driver Wizard will search all subdirectories of the driver source
directory; therefore, if there are multiple drivers to install, extract them into folders within the
same root directory, and then set the driver source directory as the root directory that holds all
of the driver source folders.
6. On the Summary page, verify that the settings are correct, and then click
Next to import the drivers into the Deployment Workbench.
7.
microsoft.com/mdt
Guide Title
97
installed only when the task sequence is run on a computer with the
devices. To ensure this, run the task sequence step for deploying the
relevant device driver applications as a conditional task sequence step.
The conditional criteria can be specified for running the task sequence
step using WMI queries for the device on the target computer.
microsoft.com/mdt
11. On the Summary page, verify the settings are correct, and then click Next to
import the device driver application into the Deployment Workbench.
12. On the Confirmation page, click Finish.
After the applications are imported into the Deployment Workbench, add
them to the deployment process using the appropriate logic to ensure that
the application installs only when running on the correct hardware. There
are different methods for achieving this:
Create a new task sequence group for each hardware model, and then add a
query to run that group of actions if the computer matches a specific
hardware type.
microsoft.com/mdt
Guide Title
99
This creates a new task sequence group in the task sequence. Use
this new task sequence group to create the steps for installing the
hardware-specific device driver applications.
7. In the details pane, click New Group.
8. On the Properties tab, in the Name box, type group_name (where
group_name is the name of the group; for example, Hardware Specific
Applications Dell Computer Corporation).
9. On the Options tab, click Add, and then click Query WMI.
10. In the Task Sequence WMI Condition dialog box, type the following details:
In the WQL query box, type a WMI Query Language (WQL) query using
the Win32_ComputerSystem class to ensure that the application is
installed only for a specific application typefor example:
microsoft.com/mdt
Note This process must be repeated for each hardware type of each device driver application to
be installed.
microsoft.com/mdt
Guide Title
101
Because of the way MDT processes the CustomSettings.ini file, you can
use it to add applications based on specific conditions. This logic will be
used to add device driverspecific applications during deployment based
on specific hardware types. Applications are referenced in
CustomSettings.ini by the applications GUID, located in the
Applications.xml file in the deployment share.
To locate an imported applications GUID
1. In the deployment share of the deployment server, open the Control folder
for example, D:\Production Deployment Share\Control.
2. Locate and open the Applications.xml file.
3. Locate the required application.
4. Locate the application GUID by locating the line enclosed in the application
<guid> tags; for example, <application guid={c303fa6e-3a4d-425e-810277db9310e4d0}>.
As part of the initialization process, both the LTI and ZTI process gather
information about the computer on which it is running. As part of this
process, WMI queries are performed and the values from the
Win32_ComputerSystem class for make and manufacturer are
populated as variables %Make% and %Model%, respectively.
These values can be used during processing the CustomSettings.ini file to
dynamically read sections of the file depending on the make and model
detected. Listing 20 shows an example of the CustomSettings.ini file.
Listing 20. Sample CustomSettings.ini Configured for a HardwareSpecific Application Installation
[Settings]
Priority=Make, Default
Properties=MyCustomProperty
[Default]
OSInstall=Y
[Dell Computer Corporation]
Subsection=Dell-%Model%
[Dell-Latitude D620]
MandatoryApplications001={1D7DF331-47B7-472C-87B3-442597EC2F7D}
Microsoft Deployment Toolkit
microsoft.com/mdt
[Dell-Latitude D610]
MandatoryApplications001={c303fa6e-3a4d-425e-8102-77db9310e4d0}
The System Information tool. Use the System Summary node in this tool to
identify the System Manufacturer (make) and System Model (model).
microsoft.com/mdt
Guide Title
103
microsoft.com/mdt
Search for the individual computer (using the MAC address, asset tag, or
similar).
Search for the location of the computer (using the default gateway).
Search for the make and model of the computer (using WMI manufacturer or
make and model queries).
For each database entry you create, you can specify deployment
properties, applications, whether to use Configuration Manager packages,
and administrators. By creating make and model entries in the database,
you can add the required hardware-specific device driver applications.
To create entries in the MDT DB to allow installation of device driver
applications
Note Repeat this process for each hardware make and model that requires a device driver
application.
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2.
microsoft.com/mdt
Guide Title
105
Option 3. Use multicasting with MDT and the Windows Server 2008 Windows
Deployment Services server role.
microsoft.com/mdt
8. In the Driver Injection section, in the Selection profile list, select the
appropriate driver selection profile.
9. In the Properties dialog box, click OK.
Note This step is not necessary if Windows PE already includes the necessary device
drivers.
microsoft.com/mdt
Guide Title
107
microsoft.com/mdt
microsoft.com/mdt
Guide Title
109
Wdsclientapi.dll
Wdscsl.dll
Wdsimage.dll
microsoft.com/mdt
Note The Windows source directory being used must match the platform of the operating
system running on the computer where MDT is installed.
2. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
3. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share/Operating Systems
(where deployment_share is the name of the deployment share to configure).
4. In the Actions pane, click Import Operating System.
microsoft.com/mdt
Guide Title
111
The Windows Deployment Services role must be installed from the Server
Management console
As with any deployment using MDT, at least one operating system WIM
image must have been imported, either as a full set of source files or as a
custom image with setup files
Note It is important to use the latest version of Windows AIK for multicasting; the copy of
Windows PE included in earlier versions of Windows AIKfor example, Windows AIK 1.0does
not support downloading from a multicast server.
microsoft.com/mdt
After a computer has been deployed, verify that the operating system was
downloaded from a multicast transmission by examining the BDD.log file
in the \Windows\Temp\DeploymentLogs folder.
There will be two entries in the logs folder, both beginning with Multicast
transfer; check them to verify that the transfer was successful. For more
information on multicast transmissions with MDT and Windows
Microsoft Deployment Toolkit
microsoft.com/mdt
Guide Title
113
microsoft.com/mdt
The MDT log files for Phase 1 are stored in the C:\MININT and C:\SMSTSLog
folders.
The MDT log files for Phase 3 are stored in the %WINDIR
%\System32\CCM\Logs folder for x86-based deployments or in the
%WINDIR%\SysWow64\CCM\Logs folder for x64-based deployments.
Use the appropriate folder when diagnosing or troubleshooting MDTrelated deployment problems.
microsoft.com/mdt
Guide Title
115
Operating Systems
Applications
Packages
Out-of-Box Drivers
For more information about performing this step, see the section,
"Managing Deployment Shares in the Deployment Workbench", in the
MDT document Using the Microsoft Deployment Toolkit.
2. Create a new task sequence based on the Litetouch OEM Task Sequence
task sequence template in the Deployment Workbench.
For more information about performing this step, see the section,
"Configuring Task Sequences in the Deployment Workbench", in the
MDT document Using the Microsoft Deployment Toolkit.
3. Create one or more task sequences that will be used to deploy the target
operating system on the target computer after deployment in the production
environment.
For more information about performing this step, see the section,
"Configuring Task Sequences in the Deployment Workbench", in the
MDT document Using the Microsoft Deployment Toolkit.
Microsoft Deployment Toolkit
microsoft.com/mdt
For more information about performing this step, see the section,
"Manage Selection Profiles", in the MDT document Using the Microsoft
Deployment Toolkit.
5. Create deployment media.
8. Deliver the ISO file or the DVD to the OEM or to the organizations staging
environment.
microsoft.com/mdt
Guide Title
117
The task sequence will start and the contents of the bootable media
will be copied to the local hard disk of the target computer.
3. When the Windows Deployment Wizard is complete for the OEM
Preinstallation Task Sequence for Staging Environment task sequence,
the hard disk will be ready to initiate the remainder of the deployment process
by running the Windows Deployment Wizard for the other task sequences
that are used to deploy the operating system.
For more information about completing this step, see the section,
"Running the Deployment Wizard", in the MDT document Using the
Microsoft Deployment Toolkit.
When this phase is complete, the target computer will be ready to use in
the production environment.
Microsoft Deployment Toolkit
microsoft.com/mdt
microsoft.com/mdt
Guide Title
119
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Creating a Folder
The following Windows PowerShell commands create an Adobe folder in
the Deployment Workbench console tree at Deployment
Workbench/Deployment Shares/Production/Applications.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Note Adding "remove-psdrive" to the script ensures that the background process
finishes before proceeding.
Deleting a Folder
The following Windows PowerShell commands delete the Deployment
Workbench/Deployment Shares/Production/Applications/Adobe folder.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Guide Title
121
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Creating an Application
The following Windows PowerShell commands create the Adobe
Reader 9 application using source files from D:\Software\Adobe\Reader 9.
The application will be stored in the Production deployment share, which
is in D:\Production Deployment Share.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Deleting an Application
The following Windows PowerShell command deletes the Adobe
Reader 9 application from the Production deployment share.
Remove-item -path "DS002:\Applications\Adobe Reader 9" -Verbose
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Guide Title
123
Creating an MDT DB
The following Windows PowerShell commands create a new MDT DB on
the deployment_server server for the Production deployment share. The
database connection will be via TCP/IP.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Creating Media
The following Windows PowerShell commands create a source folder that
contains content used to create bootable media. The Production
deployment share will be used as the source. The Everything selection
profile determines what content is placed in the media content folder. The
LiteTouchMedia.iso file will be created when the media is generated. The
media will support both x86 and x64 platforms.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
microsoft.com/mdt
Guide Title
125
Generating Media
The following Windows PowerShell commands create the
LiteTouchMedia.iso file in D:\Media, which will use content from the
MEDIA001 media source folder.
Add-PSSnapIn Microsoft.BDD.PSSnapIn
Deleting Media
The following Windows PowerShell command deletes the MEDIA001
media from the Production deployment share.
Remove-item -path "DS002:\Media\MEDIA001" -Verbose
microsoft.com/mdt
Autologon restrictions
One option to overcome the issues that a GPO might cause during
deployment is to join the computer to the domain as late as possible in the
deployment process. This join can be done using a custom task sequence
step that runs the ZTIDomainJoin.wsf script.
To join the target computer to the domain, the ZTIDomainJoin.wsf script
uses the DomainAdmin, DomainAdminDomain,
DomainAdminPassword, JoinDomain, and MachineObjectOU
properties. You can declare these properties using the Windows
Deployment Wizard, deployment share rules, the MDT DB, and
Configuration Manager computer and collection rules. The account used
must have the rights required to create and delete computer objects in the
domain.
Typically, the ZTIConfigure.wsf script updates the Unattend.xml or
Unattend.txt file with the values that these properties specify. These
settings are then parsed by the Windows Setup program, and the system
attempts to join to the domain early in the deployment process. Doing so
subjects the target computer to settings specified in domain GPOs and
can possibly cause the deployment process to fail.
To intentionally delay joining the target computer to the domain during the
deployment process, you can remove certain elements from the
Unattend.xml file. The ZTIConfigure.wsf script will skip over writing
properties to the Unattend.xml file if the associated property element is
missing from the file.
Note This sample work-around is only valid when deploying the Windows 7, Windows
Server 2008, or Windows Server 2008 R2 operating systems.
microsoft.com/mdt
Guide Title
127
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share/Task
Sequences/task_sequence (where deployment_share is the name of the
deployment share and task_sequence is the name of the task sequence to be
configured).
3. In the Actions pane, click Properties.
4. On the OS Info tab, click Edit Unattend.xml.
With the Credentials elements missing from the unattend.xml file, the
ZTIConfigure.wsf script is not able to populate the domain join information
in the Unattend.xml file, which will prevent Windows Setup from
attempting to join the domain.
To add a task sequence step that joins the target computer to the
domain
1. Click Start, and then point to All Programs. Point to Microsoft Deployment
Toolkit, and then click Deployment Workbench.
2. In the Deployment Workbench console tree, go to Deployment
Workbench/Deployment Shares/deployment_share/Task
Sequences/task_sequence (where deployment_share is the name of the
deployment share and task_sequence is the name of the task sequence to be
configured).
3. In the Actions pane, click Properties.
4. On the Task Sequence tab, go to and expand the State Restore node.
5. Verify that the Recover From Domain task sequence step is present. If yes,
proceed to step 9.
6. In the task sequence Properties dialog box, click Add, go to Settings, and
click Recover From Domain.
microsoft.com/mdt
7. Add the Recover From Domain task sequence step to the task sequence
editor. Verify that the step is in the desired location in the task sequence.
8. Verify that the settings for the Recover From Domain task sequence step
are configured to meet your needs.
9. Click OK on the task sequence Properties dialog box to save the task
sequence.
microsoft.com/mdt