Adding PowerShell support to WinPE using MDT 2012 RC1

After my last post about adding PowerShell support to WINPE I installed the latest MDT build.

Adding PowerShell support to WINPE is much easier using MDT.

Download MDT from connect Join the beta

Once installed add or create a deployment share.

Right click on the share and click properties.

Go to the Windows PE tab then click the features tab.


Select the features you want to add, click apply.

Close all the properties. Right click on the deployment share and click on update deployment share.

Once the update is complete you can use the WINPE ISO that MDT created to run PowerShell.


When PE starts up press F8 and run PowerShell by simply typing PowerShell




MDT 2012 Beta 2 changes

I have just downloaded the MDT 2012 Beta 2. On first look it seems to be the same old MDT mmc look.

On opening the deployment share properties right click on deployment share, select properties everything looks different.


MDT Deployment share properties

MDT comes with 4 tabs. General, Rules, Windows PE, Monitoring

General and rules tab have not changed but within Windows PE MDT now has multiple tabs within to specify features and driver packages.



The last tab is the monitoring tab, with MDT 2012 deployments can be monitored from the monitoring node within the deployment share. The progress of the LTI deployment process is displayed as a percentage of completion. More on this later.


Within a task sequence properties there is now a run PowerShell step, MDT now allows PowerShell scripts to interact with task sequence variables and add to logs. PowerShell uses the Microsoft.BDD.TaskSequenceModule to create the TSENV: and TSENVLIST: Windows PowerShell drives. So I wasn’t going mad when I discovered this feature a few months ago in Beta1, more later.

PowerShell snapin improvements

Speaking of PowerShell MDT 2012 beta 2 has updated cmdlets for the monitoring solution. Once again, more on this later.


There have been some major improvements in Beta 2. Ill do some more digging and testing and post more about this update soon.

Don’t be scared of the Microsoft Deployment Toolkit

Whilst at various conferences, seminars, and reading Technet forum posts, I hear and read conversations about MDT. Here are some of the highlights.

I want to deploy Windows but I’m not an enterprise, I cant afford System Center

MDT is free! Its freely available from the Microsoft solutions accelerators. It does not require System Center to work.

I do not have an extensive network, and I do not use PXE boot facilities as my users are home workers.

MDT does not require servers to deploy Operating systems. MDT is a deployment workbench, its used to bring together the various components of a deployment. You could create a media deployment which could be a DVD, USB media which contains all the deployment components.

At the moment we run XP. We are rolling out Windows 7 next year, so we will wait a while before using MDT

You can use MDT to deploy XP! Ill admit you lose some functionality like adding roles and you still have to use Sysprep instead of the more advance unattend xml files. But its still a lot more advanced than old style RIS deployments.

I added all my systems drivers to the out of the box drivers folder but when I build, it always shows two or three unknown drivers what’s going on!

The best way to build and capture a reference image is to use a virtual machine.A virtual machine doesn’t have the driver issues that physical machines have. After I moved to virtualization, I went from 10 builds down to 1! The best virtualization applications are the type that have snapshot capabilities, such as HyperV, Vmware, Virtualbox.

I want to be certified in MDT, how do I go about achieving this?

There’s no certification for MDT. However there are certifications which cover MDT and Windows deployment. Search for Microsoft exams 70-680, 70-681, and  70-686

I want to deploy to multiple sites, but I’m worried about our bandwidth, is it possible with MDT?

MDT can create linked deployment shares which holds a duplicate copy of the main deployment share on a locally held deployment share. When deploying to a remote machine, MDT can assess the network gateway and instruct the deployment to use the local deployment share.

Is it possible to automate the deployment? I don’t want to have to click through a menu on each of my 300 machines

It is possible to automate the deployment, MDT can use a database to store all the information about a deployment. When the deployment starts, MDT queries the the database, if the query finds a match to a machine listed in the database, the deployment will automate.

Hey, Can someone suggest me an article, or website on Win7 Deployment?

At the moment Windows deployment is quite a hot topic. There a number of articles and blog posts dedicated to the subject.


Deployment Research

The deployment bunny

Springboard series

Extreme deployment


Deployment Fundamentals Deployment Fundamentals – Kindle Edition

Mastering Windows 7 Deployment


Technet – Microsoft Deployment Toolkit Forum

Technet – Windows 7 Installation, Setup, and Deployment Forum


Hopefully this should help you on your way to deployment success. Good luck in your deployments.

MDT PowerShell database bulk import

Using PowerShell to read through a CSV file to add computer entries into the MDT 2010 Database

Tonight on Twitter there were a few mentions about a blog post importing computers in bulk into the MDT database using VbScript. The blog post in question was

Skatterbrainz had to convert a PowerShell Module into VBScript. The module can be found here.

I use the scripts contained within this module all the time, here is the command I use to Bulk import my computer items.

I have a CSV file with my computer information.

With each heading being a setting used in the database.


I then run the following script.

Import-Module mdtdb

$assets = Import-Csv “.Book2.csv”
connect-mdtdatabase -sqlserver yourdatabaseserver -database MDTDB4

ForEach($asset In $assets)


new-mdtcomputer -serialnumber $asset.SerialNumber -settings @{OSInstall=’YES’; OSDComputerName=$asset.OSDComputername; _SMSTSORGNAME=$asset._SMSTSORGNAME}


This will run through the CSV file and add them names and settings to the MDT database.

If you need to add different settings, just add SETTINGNAME=$asset.SETTINGNAME within the { }

So quite an easy way to quickly import items into the MDT database.

Troubleshooting MDT deployments with Trace32

Checking the logs during a deployment using MDT is a very powerful way to solve problems encountered during a build.

In older versions of MDT and BDD the deployments always came with a command prompt so you could at least work out something out.

With MDT 2010 that command prompt was taken out. Now to get a command prompt a user would have to press F8.

By looking at the logs we can find out a lot of information about your deployment.

The easiest way to view the logs is to use Trace32, Trace32 is a tool mainly used for SCCM deployments you can find it here within the System Centre Configuration Manager 2007 Toolkit V2 – You can find it here…

As you may know, when a deployment fails, it usual comes with a pink screen with some unrecognisable numbers and nothing else. By looking at the logs we can find out a lot more about the issues encountered during a deployment.

The deployment logs can be found in the following locations.

During deployment – before partition


During deployment – after partition


Once deployment ends


By using trace32 you can get meaningful logs instead of the normal jumble of words within a notepad.


How to add Trace32 to the litetouch image

Create a directory called Extras within your deployment share, and add the trace32 file to it.

Within MDT open the deployment share properties.

Within the Windows PE settings add the path to your extras folder within the extra directory to add field.

Click apply and regenerate your deployment share. Replace your boot images in WDS etc.

The next time you boot into PE, press F8 and type cd

Then open trace32 from that directory. You can then browse to your log files and see your logs populate in real time.

Dynamically viewing logs from a remote share

MDT has a property which allows logs to be added to a remote share.

By adding the following line to the customsettings file or to the deployment database, you can view your logs remotely.



Using these tools have helped me to troubleshoot my deployments, hopefully they should solve your deployment issues.

Using MDT in virtualbox

I have recently been building MDT 2010 images inside Vmware workstation. Unfortunately my trial version recently ran out.

As I need a VM platform that will cope with multiple images on my pc with the ability to take snapshots, I found Oracle’s Virtualbox.

Virtualbox is a free open source application. It works in a similar way to Workstation.

For workstation, I followed Johan Arwidmark’s blog post MDT 2010 Lite Touch, Windows XP and VMware Workstation 7.0

I tried using the same instructions for Virtualbox, it all went fine until the machine booted into winpe.

Winpe could not get past the initial BDE welcome screen. No networking could be found. But when I logged into XP on the same machine, I could get a network connection.

After a while looking for a fix on the internet I found a setting inside virtualbox for the networking options.

Open virtualbox, and go into the VM’s settings, then select network. On the adapter select advanced.

Select a network hardware relevant to your host machine.


Once this has been selected. The winpe image should have a suitable network allowing a connection to a MDT share.