OSD

OSD Options Chooser v2

Posted on Updated on

Attention – this Options Chooser has been superseded by Nick’s “version 3” which can be reviewed at https://t3chn1ck.wordpress.com/2013/06/06/osd-options-chooser-v3/

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 – https://t3chn1ck.wordpress.com/2010/01/28/hta-support-in-sccm-boot-images/

<!-- ----------------------------------------------------------- Created by Nick Moseley https://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 --------------------------------------------------------------- -->



OSD Options Chooser


<script type="text/vbscript" language="vbscript">// <![CDATA[
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>

<!-- HTML goes here -->


Computer Name

<input id="ComputerName" type="text" name="ComputerName" size="45" />

Technician Name Imaging Computer

<input id="TechName" type="text" name="TechName" size="45" />

Incident or Request Number

<input id="TicketNumber" type="text" name="TicketNumber" size="45" />

Username to add to Local Admin Group (if applicable)

<input id="UserName" type="text" name="UserName" size="45" />

<b>Select Time Zone For the Computer</b>

<input type="radio" name="TimeZone" value="Pacific Standard Time" />PST (US West Coast)

<input type="radio" name="TimeZone" value="US Mountain Standard Time" />AZT (US Arizona)

<input type="radio" name="TimeZone" value="Mountain Standard Time" />MST (US Mountain)

<input type="radio" name="TimeZone" value="Central Standard Time" />CST (US Central)

<input type="radio" name="TimeZone" value="Eastern Standard Time" />EST (US East Coast)


<b>Select Post Installed Applications</b>

<input type="radio" name="Acrobat" /> Do not install Acrobat

<input type="radio" name="Acrobat" /> Adobe Acrobat Standard X

<input type="radio" name="Acrobat" /> Adobe Acrobat Professional X



<input type="checkbox" name="ProjectStd2010" /> Microsoft Project Standard 2010

<input type="checkbox" name="StreetsTrips2010" /> Microsoft Streets and Trips 2010

<input type="checkbox" name="VisioStd2010" /> Microsoft Visio Standard 2010


<button accesskey="N" id="buttonFinish" onclick="FinishClickTasks" type="submit">Finish</button>

Created by Nick Moseley, https://t3chn1ck.wordpress.com


Scripting Dell TouchPad configurations

Posted on Updated on

We recently received the new Dell E6320 and E6420 laptops.  After deployment of our standard image, which does not contain drivers, we package the full driver installers as provided by the manufacturer.  We found that for these new laptops, scrolling was not automatically enabled for the TouchPad’s.  I would say scrolling is a defacto usability standard.  To enable scrolling for the TouchPad, simply set the following in the registry:

Key: HKLM\SOFTWARE\Alps\Apoint\Button
Value Name: EnableWheel (dword)
Value: 33

Once a user logs into Windows for the first time, the values in HKLM are then sucked into HKCU.  In this way, scrolling is enabled by default but not enforced upon the user.

WinXP Configurations

Posted on Updated on

These are a few things I have done on my WinXP images

System Settings

  • Configured Windows XP Tour to Disabled = Set value RunCount (dword) to 0 in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Tour
  • Disabled System Restore for the image build process = Set value DisableSR (dword) to 1 in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore
  • Configured Automatic Updates to Off = Set value NoAutoUpdate (dword) to 1 in HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\
  • Configured Event Viewer log files to “Overwrite as necessary” = Set value Retention (dword) to 0 in HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\[Application, Security, System]
  • Configured “Wait for network at logon” = Set value SyncForegroundPolicy (dword) to 1 in HKLM\SOFTWARE\Policies\Microsoft\WindowsNT\CurrentVersion\Winlogon\
  • Configured Offline Files to be disabled = Set value Enabled (dword) to 0 in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\NetCache
  • Uninstalled the language bar using command “regsvr32 /u /s /msutb.dll”
  • Set WinXP to use Microsoft Update (instead of Windows Update)
  • Disabled automatic restart on system failure (BSOD) = Set value AutoReboot (dword) to 0 in HKLM\SYSTEM\CurrentControlSet\Control\CrashControl\

User Settings (see Scripting HKCU Settings for more info)

  • Configured task bar to “unlocked” = Set value TaskbarGlomming (dword) to 1 in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ and set value TaskbarSizeMove (dword) to 1 in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\
  • Configured highlight newly installed programs to “disabled” = Set value Start_NotifyNewApps (dword) to 0 in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\
  • Configured Desktop Cleanup Wizard to be disabled = Set value NoRun (dword) to 1 in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanupWiz\
  • Configured IE icon on desktop to be hidden = Set value NoInternetIcon (dword) to 1 in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
  • Configured Outlook 2003 Navigation Pane order to be Mail, Calendar, Contacts, then Folder List = Set value ModuleOrder (string) to “1,2,3,6,5,4,7,8” in HKCU\Software\Microsoft\Office\11.0\Outlook\Preferences\

Settings accomplished via Unattend.txt during the XP image build

  • [Shell]
    CustomDefaultThemeFile = “C:\Windows\Resources\Themes\CompanyCustom.theme”
  • [Unattended]
    hibernation = No
  • [Components]
    msnexplr = Off
    OEAccess = Off
    rootautoupdate = On
    zonegames = Off
    deskpaper = Off
  • [Display]
    Xresolution = 1024
    Yresolution = 768
  • [TerminalServices]
    AllowConnections = 1
  • [PCHealth]
    RA_AllowToGetHelp = 0
  • [WindowsFirewall]
    Profiles = WindowsFirewall.TurnOffFirewall
  • [WindowsFirewall.TurnOffFirewall]
    Mode = 0

Binary Differential Replication for Boot Images

Posted on Updated on

I had a strange issue arise with my production SCCM boot images yesterday after including new drivers.  The package update status would go from Install Pending (version 25) and to Install Retrying (version 24) and back and forth.  In reviewing the distmgr.log file, the following subtle errors were occuring.

  • Unpacked folder for package version ENT00001.24 is being used by 9 user(s) currently
  • merging temp-delta-0000151c-00000501.rdc to \\SVR01\SMSSIG$\SMSSTAGE\\ENT00001\boot.ENT00001.wim
  • failed to read complete data from file
  • Invalid old remote file. Might be corrupted
  • Failed to copy chunks to temp file. Error code 0x8007054f
  • UpdateStagedFile failed; 0x8007054f
  • Cannot copy package ENT00001 from C:\Program Files (x86)\Microsoft Configuration Manager\osd\boot\i386\boot.ENT00001.wim to \\SVR01\SMSPKGE$\ENT00001\, Win32 Error = 0

Some SCCM forums seemed to indicate that this was an issue with BDR for image.  To resolve the situation, I did the following

  1. Removed all distribution points for the package
  2. Enabled boot image property “Disconnect users from distribution points”
    Note: I kept BDR enabled for the boot image; if my process didn’t work, then I was going to disable the setting
  3. Updated the distributions points to refresh the package version
  4. Added the boot images back onto the distribution points

So far everything looks good and is working….

Unable to Import Windows 7 Drivers into OSD

Posted on

Are you unable to import Windows 7 drivers into OSD?  A problem has been identified with SCCM 2007 SP2 when running on Server 2008, which causes the import to fail.  Contact PSS to get hotfix KB978754.  At this time, it is a “public” release internally and not published on the MS website yet.  The fix has worked in my lab environment (and likely will once I am able to implement it in production)

HTA Support in SCCM Boot Images

Posted on Updated on

Want to have HTA support in your SCCM 2007 SP2 boot images (with WinPE 3.0), but don’t want to implement MDT 2010?  Follow these short instructions to get yourself on your way!  When doing this for the first time, I recommend using a copy of the boot.wim and not your production boot.wim!!

The general process for doing this:

  1. Ensure you have installed the WAIK for Windows 7
  2. Mount the base image by using the DISM tool to a local directory share. For example,
    Dism /Mount-Wim /WimFile:C:\winpe_x86\winpe.wim /index:1 /MountDir:C:\winpe_x86\mount
  3. Add packages, and language packs as appropriate by using the Dism command with the /Add-Package option. For example, to add the HTA package you must add both the language neutral package along with the language specific package. For example:
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\WinPE-HTA.cab”

     Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\WinPE-HTA_en-us.cab”
  4. Commit the changes using the Dism command with the /Unmount-Wim /Commit option. For example,
     Dism /Unmount-Wim /MountDir:C:\winpe_x86\mount /Commit
  5. Import the .wim into SCCM and, voila, you now have a boot image with HTA support!

Reference: http://technet.microsoft.com/en-us/library/dd799244.aspx

Automatically Documenting Your Task Sequence

Posted on

The Deployment Guys created of a handy utility (v2) that will automatically format your Task Sequences so that they are readable.  It uses a stylesheet to format the .xml with nifty columns and colors.  Check it out…No more looking through confusing XML code!

http://blogs.technet.com/deploymentguys/archive/2009/02/20/update-to-the-tasksequence-documentor.aspx

HTA BackEnd Script for OSD

Posted on Updated on

This post has been updated with new code. 

Please visit OSD Options Chooser v2

There are plenty of examples out there for how to get the most out of Task Sequences for SCCM 2007 OS deployment.  But I wasn’t motivated to find out how others were doing it…Until I saw a demonstration by Jarvis Davis that he presented at MMS 2009. 

From that I built my own custom HTML Application to do what I needed.  At the moment, I have not enabled HTA support in my WinPE boot images.  So the below example is purely a “BackEnd” script which simply means that it needs to run at the towards the end of the Task Sequence so that the end-operator (or end-user) does not need to wait for much of the imaging to complete.

This HTA does the following

  • Field to enter in the name of user to add into the local Administrators group
  • Selection for US time zone to configure Windows to use (defaults to MST, since that is where I am)
  • Option to install one of 6 flavors of Adobe Acrobat
  • Option to install one of 2 flavors of Project 2003
  • Option to install one of 2 flavors of Visio 2003
  • Option to install BlackBerry desktop
  • Option to install Streets and Trips 2006

Additional things to note

  • In order to add a domain user to your local admins group, the value sDomainName = “YourDomainName” must be filled in appropriately.
  • All activity is logged into C:\CustomSystemOptions.log
  • If one of the options to install software is selected, a Task Sequence variable is created and set to True.  To utilize this, you would need to have an Install Software task that is limited to only install of the corresponding variable is set to True.  Note: the Install Software task must be after the execution of the HTA!

Handling Chassis Types In SCCM OSD

Posted on Updated on

One of the challenges with condensing workstation task sequences into a single task sequence is being able to distinguish between desktops and laptops as each typically has their own set of functions to perform when being imaged.  One of the best ways to determine this is by querying ChassisTypes in Win32_SystemEnclosure.  Unfortunately, ChassisTypes is an array value; the WQL that is used in the task sequence is limited to single values.

To work with this, add the following vbscript to a Run Command Line task.  It creates a custom Task Sequence variable that can then be used to dynamically limit certain tasks to “desktops” and others to “laptops”.

'==========================================================================
' NAME: SMSTSEnvChassisType.vbs
' AUTHOR: Nick Moseley, SCCM Administrator
' DATE  : 4/24/2009
' COMMENT: Script creates custom TS variable that can be used to distinguish
' between a desktop and a laptop for dynamically selecting which tasks
' to run in the sequence. Note that the echo statements are logged in SMSTS.log
'==========================================================================
Dim oTaskSequence, oWMI, colChassis, sChassisType, oChassis
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colChassis = oWMI.ExecQuery("Select * from Win32_SystemEnclosure")
For Each oChassis in colChassis
For  Each sChassisType in oChassis.ChassisTypes
  Select Case sChassisType
      Case 8
                Wscript.Echo "Chassis Type: Portable"
                oTaskSequence ("OSDImageType") = "laptop"
            Case 9
                Wscript.Echo "Chassis Type: Laptop"
                oTaskSequence ("OSDImageType") = "laptop"
            Case 10
                Wscript.Echo "Chassis Type: Notebook"
                oTaskSequence ("OSDImageType") = "laptop"
            Case 12
                Wscript.Echo "Chassis Type: Docking Station"
                oTaskSequence ("OSDImageType") = "laptop"
            Case Else
                Wscript.Echo "Chassis Type: Unknown"
                oTaskSequence ("OSDImageType") = "desktop"
  End Select
    Next
Next