Scripting the Migration of Applications from MDT to Configuration Manager 2012

The need to migrate applications from the Microsoft Deployment Toolkit 2013 (MDT) to Configuration Manager (ConfigMgr) 2012 without MDT integration is not uncommon. Companies use MDT as a stand alone proving ground, then decide to migrate the task sequence and applications to a production ConfigMgr system.

Manually migrating the packages however is a time consuming task. It involves:

  • Creating a Package (Including Data Source, Name, Version etc.)
  • Creating a Programme (Including command line, run time parameters etc.)

Enter Powershell.

Two scripts are used in this example:

  • Script one: Exports the application information from MDT.
  • Script two: Creates packages in ConfigMgr based on this information, complete with install command lines.

After this simply copy the application source from the Application folder of the MDT deployment share, to the location you are planning to store package source in for ConfigMgr.

Script 1 : Export the list of applications from MDT to a CSV file

Note: Update variables for:

  • Location of MDT Deployment Share.
  • CSV file location (The file containing application information exported from MDT.
$MDTDeploymentShare = "C:\DeploymentShare"
$ExportPath = "c:\temp\MDTApplication.csv"

Add-PSSnapin Microsoft.BDD.PSSnapIn New-PSDrive -Name MDT -PSProvider mdtprovider -Root $MDTDeploymentShare
Get-ChildItem "mdt:\applications" | selectName,Version,Publisher,source,Commandline | Export-Csv -Path $exportPath 

Script 2:  Create new application packages based on the exported CSV file

Note: Update variables for:

  • Location of the ConfigMgr Powershell Module.
  •  CSV file location (The file created by the first script).
  • Your site code (Mine is called ABC).
  • Location of the new directory you wish to store the application source in.
$ConfigMgrModulePath = "c:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1"
$ImportPath = "c:\temp\MDTApplication.csv"
$NewSorcePathLocation = "\\ServerName\Sources$\Applications\"

Import-Module $ConfigMgrModulePath

Set-Location ABC:

$csv = Import-Csv $ImportPath

ForEach ($line in $csv){

    $name = $line.name

    $version = $line.version

    $manufacturer = $line.Publisher

    $path = $line.Source -replace ".\\Applications\\", $NewSorcePathLocation

    $command = $line.CommandLine

    New-CMPackage-Name $name -Version $version -Manufacturer $manufacturer -Path $path

    New-CMProgram-Package -Name $name -StandardProgramName "Install" -CommandLine $command -RunType Normal -ProgramRunType WhetherOrNotUserIsLoggedOn -RunMode RunWithAdministrativeRights -DriveMode RenameWithUnc -Duration 120

}
Advertisements

MDT Error: “Media Not Found”

This error came up when I attempted to boot a PC with a Windows PE boot disk I created using Microsoft Deployment Toolkit 2008 Update 1 (MDT).

When the lite touch script attempted to run, it bombed out with the following message;

Title: ” Media not found ”
Message: “Please insert the CD, DVD or USB to complete the deployment process.”.

Turns out that this is because a MININT directory still exists on the hard drive of the target PC.

By simply reformatting the drive from the Administrator prompt using ‘format c: /fs:ntfs /q’ and then rebooting back into Windows PE again, the problem was resolved.

I presume that this will apply to MDT 2010 as well.

Richard

Missing Network Card when booting a MDT 2008 WinPE image within VMWare.

As per usual, make sure that you back everything up before making changes to your system. I am not responsible for your stuff ups!

I was attempting to deploy an image created with MDT 2008 (Microsoft Deployment Toolkit) to a VMWare virtual machine. After PXE booting my WIM image, Windows PE did not have a network card present that could talk to the deployment server (It worked first time using Citrix XenServer!)

Here is my test environment;

I have created two virtual machines on a test VMWare ESXi box.
VM One has Windows 2003, MDT 2008 and Windows Deployment Services.

VM Two is the VM I am attempting to build via MDT installed on VM one.

After mucking around with injecting the vmware drivers, changing the network card type and recreating WIM’s ad infinitum, I found out the the VMX file for the test VM was missing a couple of essential entries.

Adding the following lines worked for me;
ethernet0.startConnected = “true”
ethernet0.virtualDev = “e1000”
ethernet0.addressType = “generated”

I made the changes, uploaded them using the data store browser, started the VM, and voila!