You are here:   Research
  |  Login

Welcome to my blog, quickest way to find articles is usually to search for them.

Search in All Title Contents

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

Feb 27 2014

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:

Update July 30, 2014:
You also might want to look into this post about creating a MDT simulation environment for your PowerShell scripts:


This guide assumes you have an existing MDT Lite Touch Deployment Share (meaning MDT and ADK installed)


Step-by-step instructions

  1. On a machine in the domain, install the ConfigMgr 2012 R2+ Toolkit to the default location, navigate to C:\Program Files (x86)\ConfigMgr 2012 Toolkit R2\ClientTools, then start CMTrace and click Yes to associate .log files with it.

    The CMTrace dialog box when started the first time.
  2. Create a folder named C:\MDT and copy the following files from your deployment share, Scripts folder to C:\MDT.


    If you are using any userexit scripts, like the modelaliasexit.vbs script, copy that script to the C:\MDT folder as well (Thanks Gebray1s for pointing that out).
  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..."

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


The C:\MDT Folder

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


The C:\MDT folder after adding all needed files (again, if using any userexit scripts, add them as well)


Sample CustomSettings.ini file

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

Priority=Model, Default


[HP EliteBook 8570w]


Running the simulation

1. Open an elevated PowerShell prompt, and navigate to C:\MDT,

2 Run the Gather.ps1 script (the console will look like this):




The ZTIGather.log will look like this:




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

Happy deployment, and thanks for reading!
/ The Deployment Research team

Ami Casto

Johan Arwidmark

Blog Archive