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.

image

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.

image

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

Thanks

Paul

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.

BLOGS

Deployment Research

The deployment bunny

Springboard series

Extreme deployment

BOOKS

Deployment Fundamentals Deployment Fundamentals – Kindle Edition

Mastering Windows 7 Deployment

FORUMS

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 http://www.myitforum.com/myITToolbar/frame-click.asp?url=http://skatterbrainz.blogspot.com/2011/05/vbscript-bulk-import-for-mdt-2010.html

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

http://blogs.technet.com/b/mniehaus/archive/2009/05/15/manipulating-the-microsoft-deployment-toolkit-database-using-powershell.aspx

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.

image

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…

http://www.microsoft.com/downloads/en/details.aspx?familyid=5A47B972-95D2-46B1-AB14-5D0CBCE54EB8&displaylang=en

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

x:minintsmsosdosdlogs

During deployment – after partition

c:minintsmsosdosdlogs

Once deployment ends

c:windowstempdeploymentlogs

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.

SLShareDynamicLogging=mdtserverlog$

 

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.

http://www.virtualbox.org/

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

http://www.deployvista.com/Blog/tabid/70/EntryID/118/language/en-US/Default.aspx

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.

image

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