OSD

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)

Advertisements

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

Script to Prompt for System Name in SCCM OSD

Posted on Updated on

When doing a baremetal image in SCCM OSD, the task sequences will generate a random name for the system. To define a specific name the system is to receive, use the following VBScript.  It will prompt the end-operator to input a name and then it will set the TS variable “OSDComputerName”.

Add the script to the TS by adding a Run Command Line task after Partition Disk and before Apply Operating System.

promptsystemname

'==========================================================================
' NAME: PromptForSystemName.vbs
'
' AUTHOR: Nick Moseley
' DATE  : 6/1/2009
'
' COMMENT: This script will detect if the current assigned value for the computer name
' begins with MININT, indicating that this image is bare metal image.  It then prompts
' the end-user to enter a new computer name.
'
' VERSION : 1.1
' 1.0 (12/08/2008)- Intial script to check if the computer name begins with
'  "minint", which indicates the system was booted with CD or PXE.
' 1.1 (06/01/2009)- Added check if the computer name equals "minwinpc",
'  which indicates the system was booted with USB key
'==========================================================================

Dim sNewComputerName, oTaskSequence, sTSMachineName, bPromptName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")

' Get the name the computer is set to receive and truncate to first 6 letters
sTSMachineName = lcase(oTaskSequence("_SMSTSMachineName"))
If left(sTSMachineName,6) = "minint" Then
   bPromptName = True
ElseIf sTSMachineName = "minwinpc" Then
   bPromptName = True
Else
   bPromptName = False
End If

' Note: The wscript.echo commands are logged in SMSTS.log for troubleshooting.  They are not displayed to the end user.
If bPromptName = True Then
   wscript.echo "Detected that the computer name is scheduled to receive a random value.  Prompting user to input a standard name."
   sNewComputerName = InputBox ("Please enter a standard computer name to continue.", "Computer Name", , 30,30)
   oTaskSequence("OSDComputerName") = UCase(sNewComputerName)
   wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
Else
   wscript.echo "Computer set to receive a standard name, continuing as is."
End If