Quantcast
Channel: OS|DC
Viewing all articles
Browse latest Browse all 64

MDT 2013 : How to recover missing applications when you create a media.

$
0
0

4aa44b70189d918b

Case :

You want to build a media out of your Deployment Share, For that purpose you’ve set a selection profile filled up with all the applications required to make your deployment a success.

You update your media content to create the ISO, but you quickly discover that some of your previously selected applications are missing…

 

 

Why :

A google tribulation (thanks to NRD00) teaches us that this bug occurs mainly because the “source” field from the application settings is empty or filled  with unaccurate path…

2013-12-16_01h25_19

Reviewing my MDT habbits, it’s clear that i have lots of applications in that case ; for ease of use, i create most of my apps with the “application without sources” option, and guess what… this particular method doesn’t create the requested source directory path ! 

So, to fix this, one could suggest to simply fill the missing field… not that time man, the fields are grayed !!!

Next option could then be to suppress all apps and recreate them… or to call PowerShell to the rescue.

 

 

Solution :

All Apps infos are stored in the ..Deploy\Control\Applications.xml file.

Applications path can be found in the <WorkingDirectory> tag:

2013-12-16_12h18_38

I could just create <Sources> tag when they are missing and fill them all with the content of their corresponding <WorkingDirectory> tag.

Thanks Microsoft, this goal can be achieved dead easily with PowerShell :



#//--------------------------
#// This script by Diagg/Zany & OpenEyes.
#// http://www.zany-openeyes.blogspot.com/
#// http://www.osd-couture.com/
#//
#// Version : 0.2
#// Release Date : 15/12/2013
#// Latest Update : 16/12/2013
#// Usage :
#// Warning :
#//--------------------------

cls

#Path of the file to fix (should Be application.xml)
$AppXML = "D:\MDT-Sysprep\Deploy\Control\Applications.xml"

if (Test-Path -LiteralPath $AppXML)
{
[xml]$XmlFile = Get-Content -LiteralPath $AppXML
$i = 1

foreach($item in $XmlFile.applications.application)
{
Write-host "Item $i Source : $($item.Source)"
Write-host "Item $i Working Directory : $($item.WorkingDirectory)"

If (-not($Item.WorkingDirectory -eq $null))
{
If ($Item.Source -eq $null)
{
$NewItem = $XmlFile.CreateElement("Source")
$NewItem.Innertext = $Item.WorkingDirectory
[Void]$Item.AppendChild($NewItem)
}
Else
{
$Item.Source = $Item.WorkingDirectory
}
Write-host "New Item $i Source : $($Item.source)"
}
Else
{
Write-host "Item $i doesn't need to be updated !"
}
$i++
Write-Host "`n"
}
$XmlFile.Save($AppXML)
}


to sum up : The previous lines will create the missing <Sources> tag and systematically replace it’s content by the path from the <WorkingDirectory> tag.



2013-12-16_12h56_38



to make the script work for you, change the path at line 16 to the one of your Deployment Share.



After executing the script, you’ll have to update again your media content and will happily discover that all your applications are back for good.



My advice for your next MDT media : Run this script systematically before proceeding !!!!


Viewing all articles
Browse latest Browse all 64

Trending Articles