SCCM SP2 OSD : Custom boot image with Front End HTA
Couldn’t find all of this info gathered in one place, so here we go.
Like most shops on SCCM, we were looking for some enhancement to the default OSD setup, particularly when it comes to importing and naming workstations. One would think that this need is universal enough that Microsoft would have addressed it a little more readily (like making it an option to check in the boot image creation?), but not so much.
So we’re going to walk through the steps of creating a custom boot image and adding the front end .hta to it. Since this is SCCM SP2, we’re on Winpe 3.0 and things have changed a bit from the days of imagex.
1. I first made a copy of my x86 boot image to work with, because I’m paranoid like that. You’ll find it in \<sccm install dir>\OSD\Boot\i386. I named mine HTAboot.wim
2. We need to mount the wim to add some capabilities and copy the .hta file in. You’ll need to create the empty directory where you’re going to mount it first.
Dism /Mount-Wim /WimFile:C:\\<sccm install dir>\OSD\Boot\i386\HTAboot.wim /index:1 /MountDir:C:\mount
3. Add the packages needed to support HTA. While I was at it, I added other packages just in case I wanted to do other things later.
Dism /image:C:\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\WinPE-HTA.cab”
Dism /image:C:\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\en-us\WinPE-HTA_en-us.cab”
Dism /image:C:\mount /Add-Package /PackagePath:"C:\Program Files\<version>\Tools\PETools\x86\WinPE_FPs\WinPE-mdac.cab”
DISM /Image:c:\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-scripting.cab”
DISM /Image:c:\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab”
4. Create the tsconfig.ini and drop it in the root of the folder where you mounted the wim. This will call the HTA after boot.The file should look like:
[CustomHook]
CommandLine="mshta.exe x:\Deploy\Scripts\Bare_Metal_FrontEnd.hta"
I renamed my HTA to “Bare_Metal_FrontEnd.hta”.
5. Go grab the HTA of your choice. There are several floating around out there, the one I used with success was from MYITForum (and why wouldn’t it be?):
http://www.myitforum.com/inc/arts/12131UnknownSystem_Minimal.hta
In this one, just edit line 65 – 69 to suit your environment, name it what you want, and drop it in the mounted wim. You’ll have to create the folder structure \deploy\scripts if it doesn’t exist.
6. Unmount the wim and save it:
DISM /Unmount-Wim /Mountdir:c:\winpe\mount /commit
7. Create your new boot image in SCCM:
Under Operating System Deployment, Right-Click on “Boot Images”, Add Boot Image. Browse to the wim we just created, select the boot image, and click Next.
8. Deploy the image to a test DP.
9. Use the new boot image to create a task sequence for deployment.
10. And away you go!
With thanks to:
http://social.technet.microsoft.com/Forums/en/configmgrosd/thread/b7eb3ac3-8b19-411e-ac9a-630fbc51369a
http://www.ithastobecool.com/2009/11/02/creating-a-custom-boot-image-for-sccm-sp2-winpe-3-0/
http://www.myitforum.com/articles/19/view.asp?id=11652
http://www.myitforum.com/forums/m_200745/mpage_1/key_/tm.htm#200745
http://social.technet.microsoft.com/Forums/en/configmgrosd/thread/7acbcda1-3780-4a13-a440-2f08a3f105f5
http://technet.microsoft.com/en-us/library/bb694075.aspx