HTA to prompt for computer name and time zone in OSD of Configuration Manager

A common requirement of new operating system deployments from Configuration Manager is to have the ability to prompt for variables such as a computer name, time zone, and whether or not to install applications and updates. You could add MDT integration to Configuration Manager or you could create your own HTA using basic HTML and VBScript. However there are limitations with HTA files you should be aware of and you’ll need to tweak your task sequences.

Prerequisite configuration of boot images

The only requirement is to enable HTML (WinPE-HTA) support in your boot images. 

Some important information: HTML Applications are from the past

HTA’s have their limitations as they run in compatibility mode by default. You won’t be able to use your favorite framework since the HTA file was never really improved since IE7. A modern x-ua-compatible string cannot be used. In fact, the latest x-ua-compatible string you can use is ie=8 because VBScript is required to pass values of form elements to task sequence variables. 

This won’t work:
<meta http-equiv="x-ua-compatible" content="ie=edge">

This will work:
<meta http-equiv="x-ua-compatible" content="ie=8">

Every modern web development framework is pretty much useless. You’ll either need to build everything from scratch or opt for a deprecated framework which supports IE8 such as Foundation 3.

OSD HTA

I’ve uploaded an example HTA which I call OSD HTA. It can be downloaded below. The HTA will prompt for computer name, time zone, and whether or not to install applications and Windows Updates. I created this OSD HTA for new Windows installs but the OSD could be easily altered for your needs.

Download the files here, OSDHTA. The ZIP file contains the OSDHTA and Zurb’s Foundation 3 framework CSS.

Here’s what the basic OSD HTA will look like:

Adding the OSD HTA to your task sequence

Once you have the source files, create a package in Configuration Manager containing the HTAOSD source files. Then within your task sequence add a Run a Command step which runs index.hta. Place the task near the beginning of your task sequence but after any partition tasks.

Using the variables in a task sequence

Using the task sequence variables defined by the HTA are fairly straight forward.

Setting the time zone

Add a Run a Command task to your task sequence which calls tzutil.exe and used the task sequence variable set by the OSD HTA.

Installing applications

To achieve this I added a task sequence group and placed all my application installation steps within the group. Then I set a condition on the group based on the task sequence variable.

Installing updates

Just like the Install Applications TS variable, I added my Windows Update tasks to a group with task sequence variable condition.

Other uses for task sequence variables

You can easily update the OSD HTA file to include options for installing individual apps or changing windows additional settings. I include an option to remove all Windows 10 built-in store apps as well as customizing the default user profile.