Coretech HTA

The main idea with this HTA is to assist small and medium sized organizations with an easy way to implement a custom OSD solution without having any developer or HTML skills. The HTA solutions can be used when booting directly into WinPE and to prestage computers.

Why; You might ask, Why, do Coretech create this tool instead of using the built-in tools in Configuration Manager or using the UDI wizard in Microsoft Deployment Toolkit?  The answer is straight forward. We often run into customers who do not have the knowledge it takes to build custom solutions or use the UDI designer. Our Coretech HTA is intended to those administrators where OSD only plays a small part in their working life but never the less must have custom solution that works right out of the box.

- And hey Coretech dudes; why don’t you just use the MDT database and all the MDT features? Why do you spend time creating solutions that already exist “out there”? Well, because we are talking with multiple customers that are not OSD experts and just want to have a simple solution.

The main benefits of using the Coretech HTA is:

  • Very easy to implement
  • No developing skills are required to install or maintain the solution
  • Automate the computer naming standard
  • Easily create OSD “roles” and target specific applications/packages to each role.
  • Create custom selections like integrating USMT, Bitlocker etc.
  • Control language and time zones.
  • Configure primary user.

We control and configure most settings using variables on computer objects and collections. This method might be new to you, and will certainly require a new way of thinking.

Download HTA and Task Sequence

System requirements

The following requirements must be met before installing the HTA:

  • A domain user account, the account will be granted permissions in Configuration Manager to create and delete computer objects. The user account do not require any additional permissions. The account used in this guide is named viamonstra\cm_hta.
  • System Center 2012 Configuration Manager SP1 or later. For those who are running ConfigMgr 2012 R2, you also required to install KB2905002 and KB2907591
  • Microsoft Deployment Toolkit integration and a MDT toolkit package.
  • A share than can host the HTA files. In this blog post \\cm01\sccm_sources$\OSD will be used.

What the HTA is not

The HTA is not an Enterprise solution or a replacement for MDT.

Install the HTA

  1. Ensure you have a HTA user account created in Active Directory as mentioned in the system requirements.
  2. Run the hta_installer.exe as administrator and fill Install Folder, HTA user and Password.

    image

  3. When ready click Install close the window when the installation is done.

What happens during the installation?

  1. A new user role is created and associated with the HTA user account.

    image

    image

  2. A new boot image is added.

    image

  3. A new folder called OSD is added along with several OSD collections.

    image

  4. A Task sequence is part of the download and can be imported. The task sequence includes examples on how you can use the collection variables in the deployment.

    image

  5. During the install process, the files used to support the HTA solution is copied to the share specified in the installer. In my example the share is

    \\CM01\SCCM_Sources\OSD.

    Files in the main folder:

    HTA.exe is the main executable.

    StartHTA.vbs used to the HTA in “prestage mode”.

    Files in the Bootimage folder:

    The custom boot image

     

    Files in the Bootimage\Prestart folder:

    RunHTA.exe maps the drive letter T to the HTA file share, and executes the RunHTA.vbs

    RunHTA.vbs executes the HTA.exe main executable and waits for it to end.

     

    Files in the Config folder:

    Config.xml, the main configuration file containing information about the site server and the main OSD folder.

    Logo.png, the top logo used in the HTA.

    PCNumber.txt keeps track of the running number. The file is used if a running number is being used as part of the computer name.

    RunAfter.bat contains commands executed after the HTA.

    RunBefore.bat contains commands executed before the HTA.


    image

How to get started with the Coretech HTA solution

You are almost ready to use the solution as soon as the install is finished. Only a few details needs to be configured before you can deploy the very first image in your environment.

Modify the custom boot image

  1. From the Software Library, select Operating Systems, Boot Images.
  2. Open the HTA Boot Image (x86) boot image properties, select the Optional Components tab.
  3. Select Optional Components, click the Yellow icon and add HTML (WinPE-HTA) and Database (WinPE-MDAC) support.

    image

    image

  4. Click OK and update the boot image.
  5. Distribute the boot image to your distribution points and PXE enabled distribution points.

    image 

Deploy the task sequence

In theory the HTA is now ready for use (although you might want to customize the task sequence first).

  1. In order to use the task sequence you need to create a deployment to the Unknown computers collection and each of the collections that can contain a machine object. In the example below three available deployments are created allowing me to deploy a custom Windows 8.1 or Windows 7 image to the Developers collection.

    image

  2. WinPE will launch and show the HTA, in this example I’ll create a new Windows 8.1 computer in the developer collection. To do so, click Windows 8 and Developer. Specify a computer name (this can be 100% automated using the collection variables) and the primary user of the device.

    image

  3. Click Additional selections and select a language from the dropdown box (you can add multiple languages in the OSD collection hierarchy).
  4. Click Install to begin the image process. What happens now is that the HTA will look for an existing object in ConfigMgr, delete the object and create a new computer object in the Windows 8 Developer Collection.

    image

  5. If you open the computer properties in the ConfigMgr console you’ll notice several computer variables

    image

  6. If you open the OSD Windows 8 developer collection and select the Variables tab, you’ll find additional variables. Those are not effective by default, but can be used in the task sequence to control department specific applications and other cool stuff.

    image

  7. To deploy specific applications to the developers, open the Task Sequence and navigate to the Software –Developer step.
  8. From Add, select General, Install Application and specify the applications.

    image

  9. Select the Options tab, and click Add Condition, Task Sequence Variable.

    image

  10. In variable type HTA_Type and in value type Developer. This will ensure that only computers in a collection with the Developer variable (both Windows 7 and Windows 8.1) will run the step.

    image

  11. Click OK and close the task sequence.

Modify the default values in the HTA

The true value of the HTA is found in the simplicity when it comes to making changes. Changes like controlling the computer names, modifying the default values etc. All you need to know is the variable and the optional values. Below is the list of some of the values you can modify in the hta_main collection, after that are some examples that you might find useful.

image

Variable

Values

Example

Description

CM_CleanUp

TRUE

FALSE

TRUE

TRUE will delete all Computer Objects in Configuration Manager with the same BIOS GUID or MAC Address as the Computer being processed.

CM_RefreshAll

TRUE

FALSE

TRUE

TRUE, will update the All Systems collection.

ComputerName_Chassis_Desktop

String

D

Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Desktop.

ComputerName_Chassis_Laptop

String

L

Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Laptop.

ComputerName_Chassis_Virtual

String

V

Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Virtual machine.

ComputerName_Chassis_Tablet

String

T

Defines the Chassis value used as part of the ComputerName Structure if the Computer is a Tablet.

ComputerName_Number_Increment

TRUE

FALSE

TRUE

TRUE the Number Value will be incremented, when Number is used as part of the ComputerName Structure.

ComputerName_Number_UseText

TRUE

FALSE

TRUE

TRUE the Text field in the ComputerName Structure will be used instead of the default Number field.

ComputerName_Number_UseText_Length

Integer

4

Defines the character length of the Number. Mandatory if ComputerName_Number_UseText is configured to True.

ComputerName_Static

String

CT

Defines the value used if Static is used as part of the ComputerName Structure.

ComputerName_Structure

String Array

S2;C1;N4

Defines the ComputerName Structure, each field with its length, separated with semicolon.

C = Chassis

D = Dropdown

N = Number

R = Role

S = Static

T = Text

U= User Name

HTA_Domain

String

coretech.dk

Defines the value used as the start value for the Primary User UserName field.

HTA_Select_Type

Button

Dropdown

Dropdown

If set to Button, the Mandatory Selection section of the HTA, will be shown as Buttons.

If set to Dropdown, the Mandatory Selection section of the HTA, will be shown as Dropdown boxes.

HTA_Select_Type_Button_Columns

1

2

3

4

5

3

Defines the number of columns the Buttons in the Mandatory Selection section of the HTA, is shown in.

Needs to be defined when HTA_Select_Type is set to Button

HTA_Text_SelectRole

String

Select Role

Defines the Text to use as the header for Role Selection in the Mandatory Selection section.

HTA_Text_SelectRoleType

String

Select Type

Defines the Text to use as the header for Role Type Selection in the Mandatory Selection section.

HTA_Text_SpecifyComputerName

String

Specify Computer Name

Defines the Text to use as the header for ComputerName specification in the Mandatory Selection section.

HTA_Text_SpecifyComputerName_Structure

String Array

Static;Chassis;Number

Defines the Text to use as the headers for each part of the ComputerName structure in the Mandatory Selection section, separated with semicolon.

Needs to have the same number of parts as the ComputerName_Structure

HTA_Text_SpecifyPrimaryUser

String

Specify Primary User

Defines the Text to use as the header for Primary User specification in the Mandatory Selection section.

HTA_Text_SpecifyPrimaryUser_UserName

String

UserName

Defines the Text to use as the header for Primary User UserName specification in the Mandatory Selection section.

OSD_Name_Remove

String

OSD

Defines the text to remove from Collection Names, when showing them in the HTA.

OSD_Roles

FolderID

16777284

Defines the Root Role FolderId of the HTA Configuration

OSD_Roles_Default

FolderID

16777290

Defines the default Role choice for the HTA Configuration.

OSD_Selections

FolderID

16777285

Defines the Root Selection FolderId of the HTA Configuration

VARNAME_OSDCOMPUTERNAME

String

OSDComputerName

Defines the Variable Name of the ComputerName Value

VARNAME_PRESTAGE

String

PrestagedBy

Defines the Variable Name of the PrestagedBy Value

VARNAME_SMSTSASSIGNUSERSMODE

String

SMSTSAssignUsersMode

Defines the Variable Name of the AssignUsersMode Value

VARNAME_SMSTSUDAUSERS

String

SMSTSUdaUsers

Defines the Variable Name of the UdaUsers Value

 

Modify the HTA

The HTA is controlled by folders and collections. If you look at the main HTA you’ll notice two main buttons (Windows 7 and Windows 8), those correspond to the folders created in the Roles folder. By creating a new folder in Roles, you’ll automatically create a new main button in the image.

image

image

Once the role is selected, one or more role types are available. Those are controlled by the collections you have created in the role folder. In this example I have created 3 different Server 2012 R2 role types.

image

image

Prestaging computers

You can prestage computers by running the hta.vbs directly from the server. The only difference is that you will be prompted for a user name, password and a MAC address. Once you have entered those information you’ll be presented with the HTA from where you can configure the computer information.

image

image

 

image

What’s next

This blog post is meant to be an introduction that will give you enough information to get started with using the tool. The solution also contains other features, so stay tuned more information will follow.

This tool would never have existed if it wasn’t for my fantastic team of dedicated collegues, huge colleagues goes to both Jakob Svendsen (contributing developer) and Claus Codam (main developer).


Comments (15):

  1. Thomas Alterhaug says:

    Great work! Just wanted to inform you that the installer creates 2 x86 boot images, but no x64.

    Thomas.

  2. John Garfield says:

    Is it possible to remove the usmt and Language selections? Or remove the entire additional selections option ?

  3. Niklas says:

    Hi
    Thank you for this good information and for the hta
    Please can you explain how to display the hta during task sequence?

    It did not start automatically as describe
    Thanks

  4. tutti & co says:

    tutti & co

    Coretech Blog » Blog Archive » Coretech HTA

  5. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  6. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  7. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

    • Euan says:

      Hi,

      I’m having issues installing the HTA exe, my SCCM installation is on the D drive and it fails at creating boot. I tried copying the boot.wim to the location in the log file but still fails. Is it possible to get a copy of the source code or is there a workaround?

      Cheers,

      Euan

  8. Kent Agerlund kent says:

    There is no issue having ConfigMgr installed on the d: drive. I do that all the time. Have you deleted the OSD collections before running the install again? And do you have the correct hta account?

    • Euan says:

      Doesn’t look like it gets far enough to add the OSD collections.

      Could not copy Boot Image from: “C:\Program Files\Microsoft Configuration Manager\\OSD\boot\i386\boot.wim” to: “\\servername\SCCM_Sources$\OSD\HTA\BootImage\boot.wim”. Warning: Could not find a part of the path ‘C:\Program Files\Microsoft Configuration Manager\\OSD\boot\i386\boot.wim’.

  9. Dale says:

    When trying to import the task sequence I get an error “cannot validate a dependency to Package PS100002″. I know I don’t have that package in SCCM but how can I import it anyway and then change the reference to the package later?

  10. Kent Agerlund kent says:

    It’s the boot image, the image file and the mdt packages. Just replace the steps in the task sequence with own packages.

  11. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

  12. […] have read here, here, here, here and here for HTA .I used HTA available here and modified and used in my task […]

Leave a Reply

CAPTCHA Image
(required)