Quantcast
Channel: Deployment Research - Johan Arwidmark
Viewing all articles
Browse latest Browse all 168

Save time (and avoid pain) - Create a MDT simulation environment

$
0
0

This is an update to an old post, this time using PowerShell. Anyway, by adding a few files to a folder you can simulate the gather process of MDT, and figure out why settings fails in seconds rather than hours... Create a MDT simulation environment - here is how:

Step-by-step instructions

  1. On a machine in the domain, install the ConfigMgr 2012 R2 Toolkit, start CMTrace and click Yes to associate .log files with it.

    image
  2. Create a folder named C:\MDT and copy the following files from your deployment share, Scripts folder to C:\MDT.

    ZTIDataAccess.vbs
    ZTIGather.wsf
    ZTIGather.xml
    ZTIUtility.vbs
  3. Copy/Create the CustomSettings.ini file you want to test to C:\MDT.

  4. In the C:\MDT folder, create a subfolder named x64.

  5. From your deployment share, Tools\x64 folder, Copy Microsoft.BDD.Utility.dll to C:\MDT\x64.

  6. Create a PowerShell script named Gather.ps1 with the following information

# Check for elevation
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator"))
{
    Write-Warning "Oupps, you need to run this script from an elevated PowerShell prompt!`nPlease start the PowerShell prompt as an Administrator and re-run the script."
    Write-Warning "Aborting script..."
    Break
}

cls
if (Test-Path -Path "C:\MININT") {Write-Host "C:\MININT exists, deleting...";Remove-Item C:\MININT -Recurse}
cscript.exe ZTIGather.wsf /debug:true

# Optional, remove the comment if you want the script to open the log in CMTrace
# & "C:\Program Files (x86)\ConfigMgr 2012 Toolkit R2\ClientTools\CMTrace" C:\MININT\SMSOSD\OSDLOGS\ZTIGather.log

By now your C:\MDT folder should look like this:

MDT

In the below sample I have the following customsettings.ini file

[Settings]
Priority=Model, Default

[Default]
OSInstall=YES

[HP EliteBook 8570w]
MandatoryApplications001={980fc0ac-68eb-4227-bc57-49ac352e18d5}

If I run the Gather.ps1 script, in an elevated PowerShell prompt, the console will look like this:

image

 

The ZTIGather.log will look like this:

image

From the above log file we can see that if I would have deployed a HP Elitebook 8570w, it would actually install an application with the guid of {980fc0ac-68eb-4227-bc57-49ac352e18d5}. If I check the Deployment Workbench, I can see which application that has that guid.

/ Johan


More ...

Viewing all articles
Browse latest Browse all 168

Trending Articles