Jump to content


  • 0
anyweb

Introducing the windows-noob.com FrontEnd HTA ver 1.0

Question

Introduction:

After a lot of development and testing and countless changes it's time to release version 1.0 of the windows-noob.com FrontEnd HTA. This HTA can be used by Network administrators/techs to quickly make choices about Deployment Type (Backup, Reinstall, New Computer) for their migrations from Windows XP to Windows 7.

 

Update: This HTA has been updated with a new version here. Please review it's features.

The HTA comes with pre-written scripts that do the hard work for you and set variables based on choices made by the end user. These variables are in turn used by the backend Task Sequence to do the actual heavy lifting. If you stick to the default Task Sequence included here, then when you start it you'll see a password prompt

passsword.jpg

enter Password123 to continue, if you get it wrong it will abort the task Sequence so be careful smile.gif.

Once you've entered the password correctly the HTA itself will display, currently it's adjustable in size, you can edit the DeployMenu.hta to maximise it by editing the following lines,

<HTA:APPLICATION ID="objTest" APPLICATIONNAME="Frontend HTA" SCROLL="yes" SINGLEINSTANCE="yes">
<!HTA:APPLICATION ID="objTest" APPLICATIONNAME="Frontend HTA" SCROLL="No" SINGLEINSTANCE="YES" BORDER="none" CAPTION="no" WINDOWSTATE=MAXIMIZE SINGLEINSTANCE="yes">



frontendhta.jpg

The Backup option allows you to Backup the data in several different ways (option to run CHKDSK before backup, full WIM backup both locally and network, Offline Scanstate in WinPE which is then backed up to a network Share) and also allows you to Create a computer association between source and destination computer while in WinPE if you want to do traditional SMP based state backup (note however for SMP based scenarios that the scanstate must be performed separately while in the full Windows OS using a separate Task Sequence).]

Note: If the computer is has a computername matching MININT- then you will be prompted to enter a computername before backup continues.

backup.jpg

The Reinstall option allows users to Quickly backup data (using offline mode in WinPE and hardlinking) and install Windows 7 Enterprise on existing hardware. They can also optionally specify a user which will then become the Local Administrator of that computer.

Note: If the computer is has a computername matching MININT- then you will be prompted to enter a computername before Reinstall continues.

reinstall.jpg

The New Computer option allows you to choose regional and language options offline via drop down menus (4 languages offered, can be expanded upon easily). In addition, you can select to restore User data (or not), you can also select which OLD_computername profile to restore, or choose SMP if you want to use this New Computer as the Destination computer once a computer association has been previously made and the State captured.

new computer new installation.jpg

Requirements:

The HTA has the following prerequisites:-

* MDT 2010 update 1 integrated with ConfigMgr
* Maik Kosters Web Services 7.2 installed - quick quide here
* SCCM 2007 SP2 R2 or later
* Implement Offline scanstate in WinPE as shown here
* Install Language packs Offline using SCCM 2007 sp2


Features

The windows-noob.com HTA has the following features:-

The windows-noob.com FrontEnd HTA ver 1.0 is primarily used for Deploying (or migrating to) Windows 7, and it offers the following features,

  • Backup
  • Reinstall
  • New Computer

The three Operating System Deployment scenarios, Backup, Reinstall (refresh) and New Installation (bare metal/new computer) offer their own options, detailed below:-

Backup features
Chkdsk
full wim backup (local)
full wim backup (network)
Offline scanstate in WinPE (network)

Reinstall features
Chkdsk
full wim backup (local)
full wim backup (network)
Offline scanstate in WinPE (local using hardlinking)
Username becomes Local Administrator

New Computer Features
Regional settings (drop down choice)
Language Settings (drop down choice)
Username
Computername
Restore Users data (drop down choice, none, SMP or Offline via Network)


Additional Features

In addition to the above, you have the ability to:



Exit from the HTA
Open a command prompt
Create a Computer Association (see below)

computer association.jpg

Show information about a client, including IP Address, MAC address, GUID, etc (see below), Reboot or Shutdown.

show info.jpg

so that's the introduction now here's how to implement it in your lab..

Update:- If you want to use Multi Language or Multi Keyboard Layouts then please see this update

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

check your bdd_pkgmgr.log.txt what does it say, it will be in c:\_smstasksequence\smsosd\osdlogs\ while the language packs are installing (but not after)

Share this post


Link to post
Share on other sites

  • 0

if it's not creating the folder then possibly it's skipping the group/steps altogether, did you verify that it's running those steps ? try adding a pause to verify

Share this post


Link to post
Share on other sites

  • 0

It wasn't skipping the steps but I did find out what the problem was. When I created the package I pointed it to \\sccm\source\language\de-de\ instead of pointing it to \\sccm\source\language\

 

I changed the package and then German installed without any issues.

 

For what it's worth, I will be installing multiple languages and I setup my source folder like this - \\sccm\source\language\de-de\de-de\lp.cab so that I could create different packages for different locations.

 

Thanks for checking in Niall.

Share this post


Link to post
Share on other sites

  • 0

Hi AnyWeb,

 

I have the below HTA, This HTA was used in a different domain and now I want to impliment that in my test lab. which collect information like PC name, computer description, OU...etc at the PXE stage. the issue is i am getting an error when the HTA loads up at the beging of the task sequence

Line 71

Char:1

error: invalid syntax

code:0

 

if I say continue I get another error

 

Line :110

Char:5

error: Object required: objCommand

code:0

 

if I click continue the HTA loads up but computer sites, floor within sites and laptop model fields won't populate. I have pasted the saurce. can someone please help me with this?

 

<html>

<head>

<title>Workstation Deployment</title>

<HTA:APPLICATION

ID="objDEPLOYMENT"

APPLICATIONNAME="DEPLOYMENT"

SCROLL="no"

SINGLEINSTANCE="yes"

WINDOWSTATE="MAXIMIZED"

MaximizeButton = "no"

MinimizeButton = "no"

CloseButton = "no"

SysMenu = "no"

>

<style type="text/css">

.style2

{

font-size: medium;

font-weight: bold;

}

.style3

{

height: 54px;

}

.style4

{

}

.style5

{

height: 52px;

}

.style7

{

}

.style9

{

width: 235px;

}

.style10

{

}

.style11

{

width: 200px;

}

.style12

{

width: 250px;

}

</style>

</head>

<SCRIPT LANGUAGE="VBScript">

'**Start Encode**

strDomainName = "DJ"

strDomainMaster = strDomainName & "\administrator"

strDomainMasterPwd = "password"

strDomainController = "DJDC"

strMainCompOU = "OU=" & strDomainName & " Computers,DC=" & strDomainName & ",DC=DJ,DC=LOCAL"

strLapUtilOU = "OU=Laptop Utils,OU=Application Groups,OU=" & strDomainName & " Groups,DC=" & strDomainName & ",DC=DJ,DC=LOCAL"

Const ADS_SCOPE_SUBTREE = 2

Const ADS_SECURE_AUTHENTICATION = 1

Const ADS_SERVER_BIND = 200

Set objShell = CreateObject("Wscript.Shell")

objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\1406", 0, "REG_DWORD"

objShell.regWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1406", 0, "REG_DWORD"

 

Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=DJ,DC=LOCAL" , strDomainMaster , strDomainMasterPwd ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)

Set objConnection = CreateObject("ADODB.Connection")

Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"

objConnection.Properties("User ID") = strDomainMaster

objConnection.Properties("Password") = strDomainMasterPwd

objConnection.Properties("Encrypt Password") = TRUE

objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION

objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Page Size") = 1000

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

 

Sub CheckKeys

If window.event.altKey And window.event.keyCode = 115 then

Call alert("please do not close this window")

document.parentwindow.event.keyCode = 0

document.parentwindow.event.cancelBubble = true

document.parentwindow.event.returnvalue = false

End If

End Sub

Sub Window_onload

'On Error Resume Next

Dim objProgressUI

Dim arrSitesName()

Dim arrSitesDesc()

 

Set objProgressUI = CreateObject("Microsoft.SMS.TsProgressUI")

objProgressUI.CloseProgressDialog

window.resizeTo 800,600

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Select a computer site"

dropdownNode.Value = ""

ctrlComputerSite.Add(dropdownNode)

 

objCommand.CommandText = "SELECT name FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'"

Set objRecordSet = objCommand.Execute

i = 0

 

If objRecordSet.EOF then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "No sites have been found"

ctrlComputerSite.Add(dropdownNode)

Else

objRecordSet.MoveFirst

Do Until objRecordSet.EOF

strOUName = objRecordSet.Fields("name").Value

If Len(strOUName) > 3 then

objRecordSet.MoveNext

Else

i = i + 1

objRecordSet.MoveNext

End If

Loop

 

ReDim arrSitesName(i)

ReDim arrSitesDesc(i)

 

i = 0

 

objCommand.CommandText = "SELECT name, description FROM 'LDAP://" & strDomainController & "/" & strMainCompOU & "' WHERE objectCategory='organizationalUnit'"

Set objRecordSet = objCommand.Execute

objRecordSet.MoveFirst

Do Until objRecordSet.EOF

strOUName = objRecordSet.Fields("name").Value

If Len(strOUName) > 3 then

objRecordSet.MoveNext

Else

arrSitesName(i) = strOUName

If IsNull(objRecordSet.Fields("description").Value) Then

strDesc = ""

Else

For Each strDesc in objRecordSet.Fields("description").Value

If strDesc = "" then

Exit For

Else

arrSitesDesc(i) = strDesc

End If

Next

End If

i = i + 1

objRecordSet.MoveNext

End If

Loop

End If

d = 0

Do While d < i

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = arrSitesName(d) & " - " & arrSitesDesc(d)

dropdownNode.Value = arrSitesName(d)

ctrlComputerSite.Add(dropdownNode)

d = d + 1

 

Loop

End Sub

Sub Update_ctrlSiteFloor

On Error Resume Next

For Each dropdownNode in ctrlSiteFloor.Options

dropdownNode.RemoveNode

Next

 

strComputerSite = ctrlComputerSite.value

 

If strComputerSite = "" Then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Loading....."

dropdownNode.Value = ""

ctrlSiteFloor.Add(dropdownNode)

intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined")

Exit Sub

End If

strSiteOU = "LDAP://" & strDomainController & "/OU=" & strComputerSite & "," & strMainCompOU

i = 0

 

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Select a Site Floor"

dropdownNode.Value = ""

ctrlSiteFloor.Add(dropdownNode)

 

objCommand.CommandText = "SELECT name FROM '" & strSiteOU & "' WHERE objectCategory='organizationalUnit'"

Set objRecordSet = objCommand.Execute

 

If objRecordSet.EOF then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "No sites have been found"

ctrlComputerSite.Add(dropdownNode)

Else

objRecordSet.MoveFirst

i = 0

Do Until objRecordSet.EOF

strOUName = objRecordSet.Fields("name").Value

If InStr("Desktop", strOUName) <> 0 or InStr("Laptop", strOUName) <> 0 or strOUName = strComputerSite then

objRecordSet.MoveNext

Else

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = strOUName

dropdownNode.Value = strOUName

ctrlSiteFloor.Add(dropdownNode)

i = 1

objRecordSet.MoveNext

End If

Loop

 

If i <> 1 then

For Each dropdownNode in ctrlSiteFloor.Options

dropdownNode.RemoveNode

Next

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Site has no floors"

dropdownNode.Value = "N/A"

ctrlSiteFloor.Add(dropdownNode)

End If

End If

End Sub

Sub Update_LaptopModel

On Error Resume Next

For Each dropdownNode in ctrlLaptopMod.Options

dropdownNode.RemoveNode

Next

 

strComputerType = ctrlComputerType.value

 

If strComputerType = "" then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Loading....."

dropdownNode.Value = ""

ctrlLaptopMod.Add(dropdownNode)

intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined")

Exit Sub

End If

 

If strComputerType = "Desktop" then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "Desktop has been selected"

dropdownNode.Value = "NA"

ctrlLaptopMod.Add(dropdownNode)

Else

objCommand.CommandText = "SELECT Name FROM 'LDAP://" & strDomainController & "/" & strLapUtilOU & "' WHERE objectCategory='group'"

Set objRecordSet = objCommand.Execute

 

If objRecordSet.EOF Then

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = "No Laptop Models have been identified"

ctrlLaptopMod.Add(dropdownNode)

Else

objRecordSet.MoveFirst

Do Until objRecordSet.EOF

strGroupName = objRecordSet.Fields("Name").Value

strGroupDesc = Mid(strGroupName, 5)

intTempLen = Len(strGroupDesc)

strGroupDesc = Left(strGroupDesc, intTempLen - 13)

Set dropdownNode = document.createElement("OPTION")

dropdownNode.Text = strGroupDesc

dropdownNode.Value = strGroupName

ctrlLaptopMod.Add(dropdownNode)

objRecordSet.MoveNext

Loop

End If

End If

End Sub

Sub RunScript

On Error Resume Next

Set objTS = CreateObject("Microsoft.SMS.TSEnvironment")

Set objFSO = CreateObject("Scripting.FileSystemObject")

strComputerType = ctrlComputerType.value

strComputerName = ctrlComputerName.value

strComputerSite = ctrlComputerSite.value

strSiteFloor = ctrlSiteFloor.value

strDomainAccount = strDomainName & "\" & ctrlAccountUserName.value

strDomainPassword = ctrlAccountPassword.value

 

Set objDomain = GetObject("LDAP:").OpenDSObject("LDAP://" & strDomainController & "/DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU" , strDomainAccount , strDomainPassword ,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)

Set objConnection = CreateObject("ADODB.Connection")

Set objCommand = CreateObject("ADODB.Command")

objConnection.Provider = "ADsDSOObject"

objConnection.Properties("User ID") = strDomainAccount

objConnection.Properties("Password") = strDomainPassword

objConnection.Properties("Encrypt Password") = TRUE

objConnection.Properties("ADSI Flag") = ADS_SERVER_BIND Or ADS_SECURE_AUTHENTICATION

objConnection.Open "Active Directory Provider"

Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Page Size") = 1000

objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE

 

If err.number <> 0 then

intErrResult = MsgBox("You have supplied an invalid Username or Password. Please check your Username & Password and try again.",16,"Supplied credentials invalid")

Exit Sub

End If

 

If strSiteFloor = "N/A" Then

strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=DJ,DC=LOCAL"

Else

strDomainOU = "LDAP://OU=" & strComputerType & ",OU=" & strSiteFloor & ",OU=" & strComputerSite & ",OU=" & strDomainName & " COMPUTERS,DC=" & strDomainName & ",DC=WA,DC=GOV,DC=AU"

End If

 

strLaptopMod = ctrlLaptopMod.value

strComputerDesc = ctrlComputerDesc.value

strServiceDeskJob = ctrlServiceDeskJob.value

strFQDN = strDomainName & ".wa.gov.au"

strPreviousCompName = ctrlPreviousComputerName.value

 

i = 1

 

Do While i < 8

Select Case i

 

Case 1

If strComputerName = "" Then

intErrResult = MsgBox("You have not entered a computer name. Please enter a computer name before proceeding",48,"Computer name not Defined")

Exit Sub

Else

'If strComputerType = "Desktop" then

' If InStr(strComputerName, "PCD") = 0 Or InStr(strComputerName, "SV") = 0 then

' intErrResult = MsgBox("You have not entered a valid computer name. Please enter a valid computer name before proceeding",48,"Computer name not valid")

' Exit Sub

' End If

'End If

End If

i = i + 1

 

Case 2

If strComputerType = "" Then

intErrResult = MsgBox("You have not selected a computer type. Please select a computer type before proceeding",48,"Computer Type not Defined")

Exit Sub

End If

i = i + 1

 

Case 3

If strComputerSite = "" Then

intErrResult = MsgBox("You have not selected a computer site. Please select a computer site before proceeding",48,"Computer Site not Defined")

Exit Sub

End If

i = i + 1

 

Case 4

If strDomainName = "" Then

intErrResult = MsgBox("You have not selected a PTA Domain. Please select a PTA Domain before proceeding",48,"Domain not Defined")

Exit Sub

End If

i = i + 1

 

Case 5

If strDomainAccount = strDomainName & "\" Then

intErrResult = MsgBox("You have not entered your username. Please enter your username before proceeding",48,"Username not Defined")

Exit Sub

End If

i = i + 1

 

Case 6

If strDomainPassword = "" Then

intErrResult = MsgBox("You have not entered your password. Please enter your password before proceeding",48,"Password not Defined")

Exit Sub

End If

i = i + 1

 

Case 7

If strComputerDesc = "" Then

intErrResult = MsgBox("You have not entered a computer description. Please enter a computer description before proceeding",48,"Computer Description not Defined")

Exit Sub

End If

i = i + 1

 

End Select

Loop

 

objTS("OSDDomainName") = strFQDN

objTS("OSDDomainOUName") = strDomainOU

objTS("OSDJoinAccount") = strDomainAccount

objTS("OSDJoinPassword") = strDomainPassword

objTS("OSDNetworkJoinType") = "0"

objTS("OSDJoinSkipReboot") = "false"

objTS("OSDComputerName") = strComputerName

Set objTxtWrite = objFSO.CreateTextFile("Y:\temp\" & strComputerName & ".txt")

objTxtWrite.WriteLine(strDomainOU)

objTxtWrite.WriteLine(strLaptopMod)

objTxtWrite.WriteLine(strDomainAccount)

objTxtWrite.WriteLine(strComputerDesc)

objTxtWrite.WriteLine(strServiceDeskJob)

objTxtWrite.WriteLine(strPreviousCompName)

objTxtWrite.WriteLine(strSiteFloor)

objTxtWrite.Close

 

window.close

End Sub

</SCRIPT>

<body onkeydown="CheckKeys()">

<font face="Tahoma"><center>

<table width=100%>

<tr bgcolor="#2C7993" height=50>

<td>

<font color="#FFFFFF" face="Tahoma"><center class="style2">

Public Transport Authority System Centre Configuration Manager 2007 Image Deployment (CMR)</center></font>

</td>

</tr>

<tr height=50>

<td>

Please enter the details for this new computer</td>

</tr>

</table>

<table width=100%>

<tr>

<td class="style9">

Computer Name:

</td>

<td class="style12">

<input type="text" id="ctrlComputerName" name="ctrlComputerName" size="30" title="Enter the computer name. Example: PC100001">

</td>

<td class="style11">

Service<font face="Tahoma"> Desk Job #:</font></td>

<td>

<font face="Tahoma">

<input id="ctrlServiceDeskJob" name="ctrlServiceDeskJob" type="text" size="30"/></font></td>

</tr>

<tr>

<td class="style9">

<font face="Tahoma">Previous PC Name:</font></td>

<td class="style12">

<font face="Tahoma">

<input id="ctrlPreviousComputerName" name="ctrlPreviousComputerName" size="30"

type="text" value="N/A" /></font></tr>

<td class="style10">

 </tr>

<td class="style10">

 </tr>

<tr>

<td class="style9">

<font face="Tahoma">Computer Site:</font></td>

<td class="style12">

<font face="Tahoma">

<select id="ctrlComputerSite" name="ctrlComputerSite" onchange="Update_ctrlSiteFloor">

</select></font></tr>

<td>

<font face="Tahoma">Computer Type:</font></tr>

<td>

<font face="Tahoma">

<select id="ctrlComputerType" name="ctrlComputerType" onchange="Update_LaptopModel">

<option selected>Select a computer type</option>

<option value="Desktop">Desktop</option>

<option value="Laptop">Laptop</option>

</select></font></tr>

<tr>

<td class="style9">

<font face="Tahoma">Floor within Site:</font></td>

<td class="style12">

<font face="Tahoma">

<select id="ctrlSiteFloor" name="ctrlSiteFloor" title="Only to be used for PTC, CIT and CLA Sites">

<option>Loading.....</option>

</select></font></td>

<td>

<font face="Tahoma">Laptop Model:</font></td>

<td>

<font face="Tahoma">

<select id="ctrlLaptopMod" name="ctrlLaptopMod" title="Only to be used if machine is a laptop">

<option>Loading.....</option>

</select></font></td>

</tr>

<tr>

<td class="style4" colspan="4">

<hr />

</td>

</tr>

<tr>

<td class="style5" colspan="4">

Please enter a description of this computer:</td>

</tr>

<tr>

<td class="style9">

Computer Description:</td>

<td colspan="3">

<input id="ctrlComputerDesc" name="ctrlComputerDesc" type="text" size="60" /></td>

</tr>

<tr>

<td class="style7" colspan="4">

<font face="Tahoma">

<hr />

</font>

</td>

</tr>

<tr>

<td class="style3" colspan="4">

Please enter your admin account details to join this machine to the domain.</td>

</tr>

<tr>

<td class="style9">

User Name: </td>

<td colspan="3">

<input id="ctrlAccountUserName" name="ctrlAccountUserName" type="text" size="30" title="Enter your User Name. Example: wex103761a"/></td>

</tr>

<tr>

<td class="style9">

Password:</td>

<td colspan="3">

<input id="ctrlAccountPassword" name="ctrlAccountpassword" type="password" size="30" title="Enter your Password."/></td>

</tr>

</table>

<table width=100%>

<tr>

<td height=80>

<font face="Tahoma">

<center><input id=runbutton class="button" type="button" value="OK" name="run_button" onclick="RunScript"></center>

</font>

</td>

</tr>

</table>

</center></font>

</body>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.