Archive for September, 2011
I’ve often heard the phrase “MDT solves problems to issues you didn’t even know you had.” And it’s certainly true in this case!!
I was looking for a process or procedure that would allow me to present my current custom OSD front end HTA to an active end-user who is logged into Windows. Unfortunately, standard SCCM task sequences don’t allow this to happen. To workaround this, my first consideration was to run the HTA as a prerequisite of the task sequence, but therein lay another issue with SCCM task sequences – since the HTA was run as a prerequisite Program, it was not technically within the Task Sequence environment and therefore I could not set task sequence variables, etc.
Fortunately the good folks on the MyITForum discussion list were able to steer me in the right direction. MDT 2010 Update 1 contains a standalone executable (ServiceUI.exe) that allows execution of anything (not just an HTA) within a task sequence and enables the end-user to interact with it. To utilize ServiceUI without integrating MDT with SCCM, perform the following:
- Install MDT 2010 Update 1 on your local computer
- Find ServiceUI.exe (for the appropriate target architecture) and put it into the same directory as your HTA front end script(s)
- Create a script that will
a) Make a copy of the HTA on the local executing computer (only if your advertisement is set to “run from server”)
b) Run command: ServiceUI.exe -session:1 %SYS32%\mshta.exe C:\CustomSystemOptions.hta
Note: it’s important to know that the options “-session:1″ will only work if the user logged into Windows has local admin rights. My suggestion is to restart Windows and login as the local Administrator account.
- Update your task sequence to include a “Run Command Line” as the very first item in the task sequence
a) Name it something like “Service UI – Custom System Options”
b) Set the command line as “TheNameOfYourScript.vbs”
c) Use the package which contains your scripts
d) CRITICAL: Do not set option “Time-out (minutes)” as this will cause ServiceUI to error!
e) On the Options tab, add a condition to check that TS variable “_SMSTSInWinPE” = false
In short, this should be all that you need to get going to display the HTA to end-user. However, the thing that I do not yet have resolved in this all this is that when connected to a system through RDP, ServiceUI will launch the HTA, but it’s not displayed. Still gotta figure that one out….and then update this post of course ;-)
The following custom HTA can be used during OSD when imaging computers with SCCM 2007. It has been updated from my previous version and will do the following:
- Section 1 – for the name to be give to the computer.
- Section 2 – for the technician imaging the computer
- Section 3 – for a ticket number
- Section 4 – for adding a user to the local admins group
- Section 5 – for selecting the computer’s time zone
Note: additional time zones can be found at http://technet.microsoft.com/en-us/library/cc749073(WS.10).aspx
- Section 6 – for selecting a flavor of Acrobat as post installed software
- Section 7 – for selecting other software to be installed
- Note that on the first three sections, if the option is left empty, then after clicking finish a circular prompt is done until a value is added. Also, they set custom Task Sequence variables which you will need to use later in your process, such as in custom logging or setting a registry key for your organization, etc.
Also, remember to enable HTA support in your boot images – http://t3chn1ck.wordpress.com/2010/01/28/hta-support-in-sccm-boot-images/
<!-- ----------------------------------------------------------- Created by Nick Moseley http://t3chn1ck.wordpress.com For this script to function, HTA support must have been added into the boot image See for more information - http://technet.microsoft.com/en-us/library/dd799244.aspx --------------------------------------------------------------- --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>OSD Options Chooser</title> <HTA:APPLICATION APPLICATIONNAME="OSD Options Chooser" SCROLL="yes" SINGLEINSTANCE="yes" WINDOWSTATE="normal" BORDER="thin"> <script language="vbscript" type="text/vbscript"> window.resizeTo 375,700 window.moveTo 5,5 Sub FinishClickTasks 'On Error Resume Next Dim oTaskSequence, oShell, sComputerName, bErrComputerName, bErrTechName, bErrTicketNumber, sCurPath, sKioskName Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment") Set oShell = CreateObject ("WScript.Shell") sComputerName = UCase(ComputerName.Value) ' Set values inputed from HTA dialog If sComputerName = "" Then oTaskSequence ("OSDComputerName") = "null" Else oTaskSequence ("OSDComputerName") = sComputerName End If If TechName.Value = "" Then oTaskSequence ("OSDTechName") = "null" Else oTaskSequence ("OSDTechName") = TechName.Value End If If TicketNumber.Value = "" Then oTaskSequence ("OSDTicketNumber") = "null" Else oTaskSequence ("OSDTicketNumber") = TicketNumber.Value End If ' Check for errors with the computer name or technician name Dim sTSVar1, sTSVar2, sTSVar3, bNoErr sTSVar1 = oTaskSequence("OSDComputerName") sTSVar2 = oTaskSequence("OSDTechName") sTSVar3 = oTaskSequence("OSDTicketNumber") bNoErr = False If sTSVar1 = "null" Then bErrComputerName = True End If If sTSVar2 = "null" Then bErrTechName = True End If If sTSVar3 = "null" Then bErrTicketNumber = True End If ' Display error message If bErrComputerName And bErrTechName And bErrTicketNumber Then MsgBox "Error: Computer name, technician name, and Incident or Service Request number cannot be blank.", vbCritical, "Error" ElseIf bErrComputerName And bErrTechName Then MsgBox "Error: Computer name and technician name cannot be blank.", vbCritical, "Error" ElseIf bErrComputerName And bErrTicketNumber Then MsgBox "Error: Computer name and Incident or Service Request number cannot be blank.", vbCritical, "Error" ElseIf bErrTechName And bErrTicketNumber Then MsgBox "Error: Technician name and Incident or Service Request number cannot be blank.", vbCritical, "Error" ElseIf bErrComputerName Then MsgBox "Error: Computer name cannot be blank.", vbCritical, "Error" ElseIf bErrTechName Then MsgBox "Error: Technician name cannot be blank.", vbCritical, "Error" ElseIf bErrTicketNumber Then MsgBox "Error: Incident or Service Request number cannot be blank.", vbCritical, "Error" End If ' Loop until end-user enters a value Do If bErrComputerName Then sComputerName = InputBox ("Please enter a COMPUTER name to continue", "", , 30,30) If sComputerName <> "" Then oTaskSequence ("OSDComputerName") = sComputerName bErrComputerName = False End If ElseIf bErrTechName Then sTechName = InputBox ("Please enter a TECHNICIAN name to continue.", "", , 30,30) If sTechName <> "" Then oTaskSequence ("OSDTechName") = sTechName bErrTechName = False End If ElseIf bErrTicketNumber Then sTicketNumber = InputBox ("Please enter an Incident or Service Request number to continue.", "", , 30,30) If sTicketNumber <> "" Then oTaskSequence ("OSDTicketNumber") = sTicketNumber bErrTicketNumber = False End If Else bNoErr = True End If Loop Until bNoErr ' Set local time zone For Each oTimeZone In TimeZone If oTimeZone.Checked Then oTaskSequence("OSDTimeZone") = oTimeZone.value End If Next ' UserName to add as a local administrator If UserName.Value <> "" Then oTaskSequence ("OSDAdminUser") = UserName.Value End If ' Applications to install ' Acrobat If Acrobat(1).checked Then oTaskSequence ("OSDAcrobat10") = "standard" ElseIf Acrobat(2).checked Then oTaskSequence ("OSDAcrobat10") = "professional" End If ' Other Apps If ProjectStd2010.checked Then oTaskSequence ("OSDProjStd2010") = "true" End If If VisioStd2010.checked Then oTaskSequence ("OSDVisioStd2010") = "true" End If If StreetsTrips2010.checked Then oTaskSequence ("OSDStreetsTrips2010") = "true" End If window.close End Sub </script> </head> <body> <!-- HTML goes here --> <body STYLE="font:10 pt arial; color:white; background-color: #336600"> <p>Computer Name<BR> <input type=text id="ComputerName" name=ComputerName size=45></p> <p>Technician Name Imaging Computer<BR> <input type=text id="TechName" name=TechName size=45></p> <p>Incident or Request Number<BR> <input type=text id="TicketNumber" name=TicketNumber size=45></p> <p>Username to add to Local Admin Group (if applicable)<BR> <input type=text id="UserName" name=UserName size=45></p> <p><b>Select Time Zone For the Computer</b><br> <input type="radio" name="TimeZone" value="Pacific Standard Time">PST (US West Coast)<BR> <input type="radio" name="TimeZone" value="US Mountain Standard Time">AZT (US Arizona)<br> <input type="radio" name="TimeZone" value="Mountain Standard Time" checked="True">MST (US Mountain)<BR> <input type="radio" name="TimeZone" value="Central Standard Time">CST (US Central)<BR> <input type="radio" name="TimeZone" value="Eastern Standard Time">EST (US East Coast)<BR> <p><b>Select Post Installed Applications</b><br> <input type="radio" name="Acrobat" checked="True"> Do not install Acrobat<br> <input type="radio" name="Acrobat"> Adobe Acrobat Standard X<br> <input type="radio" name="Acrobat"> Adobe Acrobat Professional X<br> <br> <input type="checkbox" name="ProjectStd2010"> Microsoft Project Standard 2010<br> <input type="checkbox" name="StreetsTrips2010"> Microsoft Streets and Trips 2010<br> <input type="checkbox" name="VisioStd2010"> Microsoft Visio Standard 2010<br> <p><button accesskey=N type=submit id=buttonFinish onclick=FinishClickTasks>Finish</button> <br>Created by Nick Moseley, http://t3chn1ck.wordpress.com</font> </body> </html>
When distributing software, there are often challenges that can arise during installation. For example, you may have experience a time when Adobe Reader will fail to install the latest security update because the application is actively running. Or maybe you’ve found that the only way to configure QuickTime to not check for updates is by having an HKCU setting and a configuration file in the user’s profile. In attempt to get around such challenges like these, I’ve recently spent some time evaluating and retesting various common software distributions.
- Adobe Reader updates - using /qn (instead of /qb) will force the installation of the .msp patch even if Reader is actively in use
- Adobe Shockwave – The upgrade on this one is a little bit more tricky. SW will fail to upgrade if a browser is actively using the technology (no surprise) but if you try “force” the install of SW, it’ll not remove previous versions. So, you’ll first need to script the uninstall previous versions of Shockwave (you’ll want to find the uninstall key in the registry to ensure all versions have the same uninstall process). Then launch the MSI installer with /qn /norestart to force the upgrade; again this is necessary if SW is in use on a webpage. I noticed that pages actively utilizing flash with “hang”; by simply restarting the browser or tab, then SW works just fine.
- Adobe Flash – not much complicated about this. Flash successfully upgrades older version, even when flash is actively utilized in the browser. So just /qb is fine for this one.
- Apple QuickTime - the biggest headache for QuickTime is that Apple will want to check for newer versions and “other software” such as iTunes and Safari. Well, you probably don’t want you users to have either of those (or maybe their not even admins!) so you want to remove the check for updates. Anyhow, by downloading and using the default .exe installer from Apple will result in the software being installed that will check for updates. At that point, you’d have to use a custom script to do some things to disable automatic update checking. Here is the even better process: Extract the MSI files from .exe installer and only installer the two necessary components – AppleApplicationSupport and QuickTime. You can also add to your overall deployment script to uninstall versions of AppleSoftwareUpdate. Done!!
I hope these command lines are useful to you!
This post saved me from having to recreate a default boot image on a DP failing to update! It’s great for overall troubleshooting of distribution point troubles!!