Using the Microsoft Deployment Toolkit (MDT) as portable application allows to simplify the OS deployment process in branch offices. In this post you will also learn how to create and update a Deployment Share for the portable MDT.

Damien Van Robaeys

Damien Van Robaeys is a system and desktop engineer who focuses on PowerShell and the Microsoft Deployment Toolkit. You can follow him on Twitter and on his blog.

In our organization we manage OS images centrally and we don’t want the local IT departments to modify our master images. To allow the local support staff to add specific applications to our images, we send them a portable version of the MDT. This way, they don’t have to install the toolkit which would be too complicated for the local support staff.

Using the MDT as portable application ^

The MDT installation files are located by default in “C:\Program Files\Microsoft Deployment Toolkit”. The ADK installation files are located by default in “C:\Program Files\Windows Kits\10”.

The use of MDT without installing it can be achieved in three steps. You start by creating two folders that will contain respectively, required files for MDT and required files for ADK.

See below, what these folders should contain:

  • MDT_Module è Required files from MDT installation
  • ADK_Module è Required files from the ADK installation

Note: If you already have a Deployment Share make sure you use the same version of MDT you used to create the deploy contents.

The MDT_Module folder should contain the folders below from “C:\Program Files\Microsoft Deployment Toolkit”.

MDT_Module folder content

MDT_Module folder content

The ADK_Module folder should contain the folders below from “C:\Program Files\Windows Kits\10”.

ADK_Module folder content

ADK_Module folder content

The Assessment and Deployment Kit folder should contain the folders below:

Assessment and Deployment Kit folder content

Assessment and Deployment Kit folder content

The Deployment Tools folder should contain the folders below:

Deployment Tools folder content

Deployment Tools folder content

The Windows Preinstallation Environment (PE) should contain the folders below:

Windows PE folder content

Windows PE folder content

The second step is to create two registry keys that will contain the paths to both (MDT_Module and ADK_Module folders).

The first key that you should create is “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Deployment 4”.

In this key, you create a string “Install_Dir” with value the path of the MDT_Module folder.

Registry Key for MDT to create

Registry Key for MDT to create

 The second key that you should create is “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits” then create a Key “Installed Roots”.

In this key, you create a string “KitsRoot10” with the value of the path of the ADK_Module folder.

Registry Key for ADK to create

Registry Key for ADK to create

The following script, will allow you to automate the registry key creation.

This script is composed of four parts:

  • Creates the Deployment 4 Key in HKLM:\SOFTWARE\Microsoft\
  • Creates the String Install_Dir with value the path of the MDT_Module folder
  • Creates the Key Windows Kits in HKLM:\SOFTWARE\Microsoft\
  • Creates the Key Installed Roots in HKLM:\SOFTWARE\Microsoft\
  • Creates the String KitsRoot10 with value the path of the ADK_Module folder

Once it’s done, create a PSDrive that will be mapped to the Deployment Share folder. The script below allows you to automate the tasks mentioned earlier: (a) import the MDT module and (b) create a PSDrive “DSManager.

New PSDrive DSManager

New PSDrive DSManager

Consider the following variables for all the scripts used in this article:

  • $module -> location of the five files mentioned above ($module=”c:\MDT_module”)
  • $Deploymentshare -> location of your Deployment Share ($deploymentshare=”c:\deploymentshare”)

So far, we’ve learned how to use the MDT module. Now let’s create a Deployment Share, then update it, and finally, add/remove an item using the above method.

Creating the Deployment Share ^

The Deployment Share includes your entire master image configuration (operating systems images, applications, language packs, etc.). This is actually the main part of the toolkit.

With the help of the New Deployment Share wizard, you can easily create the Deployment Share. The screenshot below gives an example about the default Deployment Share information.

New Deployment Share Wizard summary

New Deployment Share Wizard summary

Instead of adding this information with the GUI, you can use PowerShell to automate the task. The script is below creates the Deployment Share and is composed of four parts:

  • Asks for your Deployment Share’s location and name
  • Creates the Deployment Share folder
  • Imports the MDT module
  • Creates a new PSDrive “DSManager” mapped to your DeploymentShare

Updating the Deployment Share ^

Your Deployment Share needs to be updated if any changes are made in the boot image, for instance after adding drivers or changing the bootsrap.ini file.

Right-click on your Deployment Share and then “Update Deployment Share”.

Update Deployment Share in GUI

Update Deployment Share in GUI

Within the Update Deployment Share wizard, the options below are available:

MDT Update deploymentshare options

MDT Update deploymentshare options

  • Optimize the boot image updating process -> Update existing versions of the image files in your Deployment Share. Choose this option to reduce the amount of time required to update the boot images.
  • Completely regenerate the boot content -> This option will create a new version of all the image files in your Deployment Share. Choose this option if you want to force the creation of new images. However, this may take more time.

The PowerShell cmdlet used to update the Deployment Share is update-MDTDeploymentShare. As you can see in the following screenshot, the next script allows you to update your Deployment Share using one of three options:

  • Update and optimize the boot image updating process
  • Update, optimize, and compress the boot image updating process
  • Completely regenerate the boot images
PowerShell script - Update your Deployment Share choice

PowerShell script - Update your Deployment Share choice

This script is composed of three parts:

  • Loads the MicrosoftDeploymentToolkit module
  • Creates a new PSDrive “DSManager” mapped to the Deployment Share
  • Updates the Deployment Share depending on the option you have chosen

Note that script needs some time to complete.

The screenshot below shows the script progress.

Update Deployment Share process

Update Deployment Share process

Adding an item to the Deployment Share ^

Adding an application

The PowerShell cmdlet used to add an application to the Deployment Share is Import-MDTApplication.

For an application bundle add -bundle to this cmdlet. In my previous post I explained how to add and remove an application in MDT with PowerShell and shared some scripts for the purpose.

Adding a package

In MDT, two package types are available:

  • OnDemand packages è Update or security packages
  • LanguagePack packages è Language packs you want to install on your Operating Systems

The PowerShell cmdlet used to add a package to the Deployment Share is Import-Mdtpackage.

You can use the script below to add a package to your Deployment Share. After you enter the name and the location of your package sources, the script will add the package to your Deployment Share. In this example the CAB file is located in C:\fr-FR_languagePack_Win10.

After entering your package sources, the process will start.

Result of the PowerShell script to add a package

Result of the PowerShell script to add a package

Removing an item from the Deployment Share ^

The PowerShell cmdlet used to remove an item from a Deployment Share is Remove-Item. This cmdlet can be used to remove an application, package, or Operating System.

The next script (a) asks for the item name you want to remove; (b) imports the MDT module; (c) creates the PSDrive mapped to your Deployment Share; and (d) removes the selected item.

Powershell script to remove a package

Powershell script to remove a package

Result of the PowerShell script to remove a package

Result of the PowerShell script to remove a package

Win the monthly 4sysops member prize for IT pros

Share
0

Related Posts

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

CONTACT US

Please ask IT administration questions in the forum. Any other messages are welcome.

Sending
© 4sysops 2006 - 2017

Log in with your credentials

or    

Forgot your details?

Create Account