I’ve always been somewhat underwhelmed with the freedom given to us by Microsoft with the standard menus in SCCM 2012 and SCCM 2012 R2 – To me, having a task sequence for each little task annoyed the living hell out of me. I work for an MSP that images machines using SCCM 2012 R2. We try to connect the machines to a KVM over IP switch so our 1st line engineers don’t have to sit next to a bunch of machines all day. They connect the machine and go back to their own desk and are able to control the machine. This would work great if it wasn’t for one of the major pitfalls that SCCM has: The endless stream of reboots in between tasks.
I’ll give you an example;
We often need to make file based backups of machines before imaging them. To do that we would create a Task Sequence: File Based Backup, which launched our backup tool of choice, and reboots after the TS is complete(Default SCCM behavior), then after PXE booting the engineer can choose to run another image based backup (Safety first right?) of course the engineer would have to PXE boot the machine again after which we would need another Task Sequence to back the machine up, meaning we’re going to bump into another reboot after this – And the engineer needing to intervene again to PXE boot the machine.
After having the “normal” SCCM systems in place for some time I decided it wouldn’t cut it for us. I’ve started looking around and found the following post on the Windows-noob forums. This shows a simple HTA file to perform several tasks – Exactly what we needed.
After some quick modifications to our TS, and combining them this is the following result;
Using the buttons you can select several tasks, like this;
Of course you can add these tools, driver-sets, or menus easily by editing the HTA file and after that, editing the TS. My TS currently looks like this:
To achieve that when you click the “Start imaging” button the correct image, drivers, and software is selected the HTA uses vbscript to set the TSENV properties. TSENV is where you can store variables related to the Task Sequence you are currently running.
Example time! If I want to run a Windows 8.1 English Installation, I do the following;
<option value=”W8NL”>Windows 8.1 NL x64</option>
<option value=”W8ENG”>Windows 8.1 ENG x64</option>
<input id=runbutton type=”button” value=”GO” name=”run_button” onClick=”vbscript:ButtonFinish”>
‘We hide the TS Progress bar – Its annoying because it keeps focus.
Set ProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
‘Sets up actions to follow clicking on GO butoon.
SET TSEnv = CreateObject(“Microsoft.SMS.TSEnvironment”)
‘Sets Variable for image W8NL
If ImageName.value = “W8NL” then
wimimage = “W8NL”
‘Sets Variable for image W8ENG
If ImageName.value = “W8ENG” then
wimimage = “W8ENG”
TSEnv(“wimimage”) = wimimage
‘When we close the window – The TS will continue and start the imaging process
And we set up the TS like this;
Of course this is a very quick and dirty example; but it’s to demonstrate the power of using HTAs and TSENV variables. And there you have it – Enough instructions to create your very own HTA menu that prevents unnecessary reboots!
I think that’s enough for a first blog – Next time I will talk about how to create general images for use on most PC models – Or maybe some powershell tips and tricks 🙂