Monday, May 30, 2011

How to run a script in WinPE before MDT HTA Wizard screen pops up

Recently I've been having issues reimaging machines with a Lite Touch Image (built using MDT2010), where when I plug in the media in the machine and reboot in Winpe, instead of getting the HTA Wizard screen, I get an error that task sequence crashed (before it even started!)

A little basic background on some MDT behavior first in light of the explanation; When an LTI MDT image is applied to a machine successfully AND the machine is rebooted (ex: hit the finish button on the summary page, set the rule FinishAction=REBOOT in customsettings.ini, etc..), MDT scripts are supposed to do a cleanup of whatever task sequences, logs files, etc.. that were moved to the machine during deployment. These files are located under:
  1. C:\_SMSTaskSequence 
  2. C:\MININT 

MDT2010 does a good job cleaning most of the times (except for keeping some DLLs under C:\MININT which are totally harmless), but sometimes that's not the case. An example could be that:

  1. The task sequence crashed somewhere in the middle
  2. The deployment guy never hit the Finish button on the Final Summary page when deployment ended. 

And so, when trying to reapply the image and the machine is booted into WinPE, it picks up whatever task sequence found under C:\_SMSTaskSequence or C:\Minint.

After hours of research trying to figure out a way to clean those folders, I came across this simple solution:
  1. Mount WinPE image file from E:\content\boot\LiteTouchPE_x86.wim (where E is the media drive letter)
  2. Create a batch script to delete the folders (ex: RMDIR /S /Q C:\_SMSTaskSequence) and place it under %MOUNTDIR%\Windows\system32\ 
  3. Open %MOUNTDIR%\Windows\System32\winpeshl.ini and add the command to launch the custom script before bddrun.exe. An example of the ini contents are as below:
  4. Unmount the wim

That's all!  

Note that everytime you regenerate the media the wim file will be replaced with the default one from MDT and the above steps will have to be redone.

Sunday, May 29, 2011

Teched 2011 Videos

For those who missed attending Teched Atlanta 2011, breakout session videos can be found on msdn channel 9. My recommendations are:
  • Absolute Offline Servicing Windows OS (Nystrom Level 3) by Johan Arwidmark,Mikael Nystrom
  • Troubleshooting Windows 7 Deployments: In Depth (Level 4) - Keith Garner, Michael Niehaus
  • Microsoft System Center Configuration Manager 2012: Application Management Overview (Level 3) - by Wally Mead
  • Inside Panther: Troubleshooting the Windows Setup Engine (Level 4) by Johan Arwidmark
  • Microsoft diagnostics and Recovery Toolset (DaRT) (Level 3) By Paul MacKnight
  • Case of the Unexplained 2011: Windows Troubleshooting with Mark Russinovich (Level 4) by Mark Russinovich
  • Deployment Internals: Mastering Windows Deployment Services (Level 3) By Johan Arwidmark

Things that I want to see:
  • Planning and Deploying Microsoft Forefront Endpoint Protection 2010 with Microsoft System Center Configuration Manager ( Level 3)
  • We Don't Need No Stinkin' GUI: Command-Line Capture Techniques (Remote Options)
  • Microsoft System Center Orchestrator 2012 Overview 
  • Microsoft System Center Virtual Machine Manager 2012: What’s in It,and How It Enables the Building of Private Clouds and Federation to the Public Cloud
  • The Enhanced Mitigation Experience Toolkit (Level 3)
  • Failover Clustering and Hyper-V: Multi-Site Disaster Recovery (Level 3)
  • The Ultimate Guide to Wireless Network Security ( Level 3)
  • Windows Powershell Remoting, Definitely not just for Servers (Level 3) by Don Jones
  • Mysteries of Memory Management Revealed,with Mark Russinovich (Part 1 of 2) ( Level 4) by Mark Russinovich
  • Maximizing Windows 7 Performance: Troubleshooting Tips
  • Optimizing Group Policy in Virtual Desktop (VDI) Environments (Level 3) by Darren Mar-Elia
  • Inside the LAB: Building Your Own Private Cloud Infrastructure (Level 3) by Michael Nystrom
  • Failover Clustering and Hyper-V: Multi-Site Disaster Recovery (Level 3) by Jeffery Hughs, Henry Aloisius
  • Hey,You! Get Off My Network! (Level 4) by Erdal Ozkaya
  • DirectAccess Implementation and Integration Deep Dive (Level 4) by Rand Morimoto
  • Windows Server 2008 R2: Tips for Automating the Breadth of Your IT Environment ( Level 3) by Dan Harman, Mir Rosenberg
  • Advanced Automation Using Windows PowerShell 2.0 ( Level 4) by Dan Harman,Jeffrey Snover
  • The Ultimate Guide to Wireless Network Security (Level 3) by Hasain Alshakarti
  • Migrating to IPv6 with Windows Server 2008 R2 and Windows 7 (Level 4) by Martijn Bellaard

Saturday, May 28, 2011

A new blog is born!

Welcome to my new blog. I will be using this space to share news/information/tips&tricks for IT Pros. Stay tuned!