I always want to make different task sequence with different passwords and assign them to the corresponded people, so the system image or re-image can be delegated to non-it people. However the task sequences need to be accurate with the limits on them. For example (Desktop Re-image can only be performed on Class Room Computers and also only the leading(Smart) teachers knows how to use it other than everyone knows it. Things like that should make our life easier.

Here is my little experiment with customized HTA interface, you can pick task type to let it finish the rest. Also to get into this task, you need have the password.  It is very simple and primitive however it is also very easy to understand.

Here is the overview of task sequence, then we can look into the details.

1. Add HTA support to WINPE. 

You need use a image from windows 8.1 boot disk other than the default one from SCCM. To add the HTA support you need go to boot image properties -> Optional Components -> Icon like sun ->HTML(Winpe-HTA).

AddOption

 

2. Task sequences.

Overview, Dont worry about the validation part in this article, I have Options as choose task, when task is choosed, a task variable called TaskType will help decide what will be peformed and what not.

 

 

3. To make the Option we need create a HTA file with scripts like following: 

<html>
<head>
<title>OSD System Menu</title>
<HTA:APPLICATION 
     ID="objAutoRefresh"
     APPLICATIONNAME="Auto Refresh"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="maximize"
     icon="icon.ico"
     SHOWINTASKBAR="no"
     SYSMENU="no"
>
<link rel="stylesheet" type="text/css" href="/skin.css">
</head>


<SCRIPT LANGUAGE="VBScript">

on error resume next

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
Set objOSD = CreateObject("Microsoft.SMS.TSEnvironment")
Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI") 
oTSProgressUI.CloseProgressDialog 
Set oTSProgressUI = Nothing
  
Sub Window_Onload

   self.Focus()
End Sub

Public Function OpenProgressDialog

Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI") 
oTSProgressUI.CloseProgressDialog 
Set oTSProgressUI = Nothing

End Function

Sub RunScriptTeacher
objOSD("TaskType")="Teacher"
objOSD("ALLOWOSDBUILD") = "YES"
Set objOSD = Nothing
window.close()
End Sub

Sub RunScriptStudent
objOSD("TaskType")="Student"
objOSD("ALLOWOSDBUILD") = "YES"
Set objOSD = Nothing
window.close()
End Sub

Sub RunScriptReImage
objOSD("TaskType")="ReImage"
objOSD("ALLOWOSDBUILD") = "YES"
Set objOSD = Nothing
window.close()
End Sub

Sub RunScriptMAC
objOSD("TaskType")="MAC"
objOSD("ALLOWOSDBUILD") = "YES"
Set objOSD = Nothing
window.close()
End Sub


Sub RunScriptCapture
objOSD("TaskType")="Capture"
objOSD("ALLOWOSDBUILD") = "YES"
Set objOSD = Nothing
window.close()
End Sub

</SCRIPT>
<style type="text/css">
</style>
/* This button was generated using CSSButtonGenerator.com */

<body >

<span id=osdSpan>
<FORM name=osdForm>
<div style="width:100% ;text-align: center; ">
<div style="width:50%; margin: 0 auto;position: relative; top: 70%">
Choose task
<table >
 <tr>
  <td><a href="#"  onclick="RunScriptStudent">STUDENT</a></td>
   <td><a href="#"  onclick="RunScriptTeacher">TEACHER</a></td>
     <td><a href="#"  onclick="RunScriptCapture">Capture</a></td>

	</tr>
	<tr>
	  <td><a href="#"  onclick="RunScriptReImage">REIMAGE</a></td>
	    <td><a href="#" onclick="RunScriptMAC">MAC</a></td>
	
		</tr>
  
</table>
</div>
<div>
</FORM>
</span>

</body>

</html>

 

Save the above code into OSDMenu.hta, then create a package contains this file, then add the task sequence like follow:

TaskTypeVariable

StartOSDInterface

So in the real task deployment you will see this. or something similar since I have removed CSS to brand this file to not confuse you.

 

 

After you choose your task type, we just need add the task sequence variable into conditions:

Option

 

And try put the same computer tasks into a group other than add options individually. Hopefully this can help you a bit.

 

About Lei

I am an IT specialist with over 10 year experience - years on Automation, on-Premise or Azure.

I am happy to develop however never want be a full time developer. Only do what I have to do. If it has to be PowerShell,HTML, PHP, CSS, C#, VBS or JS, front end or backend, so be it, doesn't matter!

Spent years with Windows, SCCM, SharePoint, SQL and Exchange servers. For last several years, I have been actively working under On Premise > Azure environment.

THERE IS NO WAY BACK!!!

Current Certificates:
    Microsoft® Certified-
  • -Enterprise Administrator
  • -Database Administrator
  • -SharePoint Administrator
  • -Administering and Deploying SCCM 2012
Red Hat Certified Technician
ITIL V3 Foundation - Practitioner

Working on Azure Certificates now and hopefully they can stop upgrading their questions one day! GIVE ME A BREAK!

Contact Lei

Name *
Email *
Comments *

Traffic since 10/08/2016

Today48
Yesterday83
This week672
This month1968
Total416328

Visitor Info

  • IP: 54.227.51.103
  • Browser: Unknown
  • Browser Version:
  • Operating System: Unknown

Who Is Online

1
Online

2017-12-17

Login