How To Set A Custom Background For OSD + Show Progress

Jason Barrett Jason Barrett | | Task Sequence

Hello, Today I am going to show you how to set a custom background for OSD (Operating system deployment)

I will cover how to change the background to a singular static custom background, and then how to set the background which will show the osd progress depending on what step the task sequence is on, as shown below.

custom osd background with progress screens step

Personally I use the above background on all my SCCM environments because I feel it looks much better than the default background and it also give you more information about the osd process.

NOTE : Are you looking to creating a custom GUI to capture task sequence variables? If yes take a look at this article I wrote on How To Create A Gui To Capture Task Sequence Variables

How To Set A Custom Background For OSD

Below I will show you how to add a single image which will display as the background when you are deploying an operating system.

  1. Prepare an image which is 1024 pixels wide and 768 pixels high
  2. Copy the file to your SCCM server
  3. Open the SCCM console
  4. Go to \Software Library\Overview\Operating Systems\Boot Images
    boot image properties
  5. Click the customization tab
  6. Tick the box “Specify the custom background image file”
  7. Click browse
  8. Enter the unc path to the image file
  9. Click ok
  10. Click ok
    boot image customization tab
  11. You will get a prompt to distribute the boot image with the new version. Click yes
    distribute boot image
  12. On the update distribution points with this boot image click next
    update sccm dp with new boot image
  13. Click next, The boot image will be regenerated and distributed, expect this to take a few minutes
    update distribution points status
  14. Click close
  15. Now start the SCCM task sequence and you should see the custom background you just set
    Custom Background For OSD

Custom Background With Progress For OSD

Next I will show you how to add a custom background to your operating system deployment which will keep changing depending on which step in the task sequence you are.

For example you can configure the background to change on the following steps

  • Installing Operating System
  • Applying Drivers
  • Configuring Operating System
  • Installing Applications
  • Installing Software Updates

You will also see information such as

  • Time the OSD started
  • Assigned Computer Name 
  • Networking Information
  • Management Point Connected To
  • Elapsed Time

To implement this we are going to use an application called TSBACKGROUND. To implement this follow these steps

  1. Download the TSBACKGROUND files here
  2. Extract the TSBackground.zip file we downloaded
  3. Copy the \TSBackground folder in to a location on your SCCM server where you keep the files for SCCM packages
  4. You should see the following files and folders once copied, note there should be two TSBackground folders
    TSBackground folder
  5. Go in to the backgrounds folder and replace the Background.jpg with your own custom background. Important to keep the same file name
    update background_jpg
  6. Now take a look in your task sequence and note down what steps you want to list on the progress steps
  7. Below for example I have 5 steps
    1 – Install Operating System
    2 – Apply Drivers
    3 – Setup Operating System
    4 – General Applications
    5 – Software Updates
    check task sequence for steps
  8. Now open the file “TSBackground\Layout\Status.xaml” in notepad
  9. We now need to edit the text for the progress steps, We need to change the highlighted text below
  10. I am also going to change the font colour
    edit status xml. file
  11. Below shows the changes I have made, I changed the name for 5 progress steps and I also removed the “Customize Windows” and “Finalizing OSD” steps
  12. Make sure you edit each section in between the <StackPanel> sections, There are six sections
    status xml after changes made
  13. Now we need to test we have configured everything correctly, To do this copy the Backgrounds and Layout folder
    TSBackground Copy Folders
  14. Go to the folder where you extracted the files from TSBackground.zip and paste the folders in to the “TSBackground\TSBackground\Tools and Script\Design viewer” folder overwriting the existing folders
    TSBackground Paste Folders
  15. Double click on “TSBackground\TSBackground\Tools and Script\Design viewer\DesignViewer.exe”
  16. In the TSBackground Design viewer application tick the boxes General, Status01 and Progress
  17. This will give you an idea what the OSD Wizard will look like. Below I need to edit the “Install Software Updates” text
    TSBackground design viewer
  18. Now unselect Status01 and select Status02, you should see the “Apply Drivers” step now highlighted
    Apply drivers step
  19. Now select each Status0* step in turn to make sure they all look correctly setup and formatting as expected
  20. In the SCCM Console go to \Software Library\Overview\Operating Systems\Task Sequences
  21. Edit the task sequence you want to show the progress updates for
  22. Click Add > General > Run Powershell ScriptAdd Powershell step
  23. Give it a name of “TSBackgroundInit”
  24. Make sure it is the first step in the task sequence
  25. Under description and parameters enter “-NumberOfStepsInErrorGroup 6” Replace the number 6 with the amount of steps you have
  26. Set Powershell Execution Policy to bypass
  27. Select enter a powershell script “Add Script”
    TSBackgroundInit step
  28. Enter the below powershell code, Then hit ok

    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$True,Position=1)]
    [string]$NumberOfStepsInErrorGroup = “0”,
    [string]$DateTimeFormat = “yyyy-MM-dd HH:mm:ss”
    )

    function Get-IP {

    (gwmi -Class ‘Win32_NetworkAdapterConfiguration’ -Filter “IPEnabled = 1”) | foreach {

    $_.IPAddress |% {
    if($_ -ne $null) {
    if($_.IndexOf(‘.’) -gt 0 -and !$_.StartsWith(“169.254”) -and $_ -ne “0.0.0.0”) {
    $ip = $_

    }
    }
    }
    }

    $ip
    }

    function Get-MacInfo {

    $nic = (gwmi -Class ‘Win32_NetworkAdapter’ -Filter “NetConnectionStatus = 2”)
    $nic.MACAddress -join ‘,’
    }

    try {
    Start-Sleep -Seconds 5
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment

    $OSDComputerName = $tsenv.Value(“OSDComputerName”)
    $SMSTSMachineName = $tsenv.Value(“_SMSTSMachineName”)
    $Mac = Get-MacInfo
    $IP = Get-IP

    $IsInPe = $tsenv.Value(“_SMSTSInWinPE”).ToUpper().Equals(“TRUE”)
    $st = $tsenv.Value(“TSBStartTimeTicks”)
    $TSBIsRunning = (gwmi -Namespace ‘Root\Cimv2’ -Query “Select * From Win32_Process Where Name = ‘TSBackground.exe'”)
    $tsenv.Value(“TSBNumberOfStepsInErrorGroup”) = “$NumberOfStepsInErrorGroup”

    if ($IsInPe -and !$TSBIsRunning) {
    Start-Process -FilePath “X:\sms\PKG\SMS10000\TSBackground\TSBackground.exe”
    }
    elseif (!$st) {
    $tsenv.Value(“TSBStartTime”) = [System.DateTime]::Now.ToString(“$DateTimeFormat”)
    $tsenv.Value(“TSBStartTimeUTC”) = [System.DateTime]::Now.ToUniversalTime().ToString(“$DateTimeFormat”)
    $tsenv.Value(“TSBStartTimeTicks”) = [System.DateTime]::Now.ToUniversalTime().Ticks
    }

    $tsenv.Value(“TSBConnectionInfo”) = “52032916-965B-480E-B2D0-C16FE6BCB4DA;$($OSDComputerName);$($SMSTSMachineName);$($Mac);$($IP);”
    exit 0
    }
    catch {}

    exit 1

    enter powershell code

  29. Click Add > General > Run Command Line
    add command line step
  30. Make sure this step is 1 under the previous step we just created
  31. Give this step a name of “TSBConnectionInfo”
  32. In the command enter “cmd /c exit “%TSBConnectionInfo%”
    TSBConnectionInfo
  33. Next click on the Apply Drivers section
  34. Click Add > General > Set Task Sequence Variable
    set task sequence variable
  35. Set the “Set Task Sequence Variable” step to be the first to run in the apply drivers section
  36. Name the step “Status 02 (Apply Drivers)”
  37. Enter “TSBStatus” for the Task Sequence Variable
  38. Give a value of General,Status02 (This will show the general and Status02 which we saw in the Design Viewer Application
    Status 02 (Apply Drivers)
  39. Add another “Run Powershell Script” just before the “Setup Windows and Configuration Manager” Step
  40. Give it a name of “GatherLocal”
  41. Set Bypass for PowerShell execution policy
  42. Click add script and add the code on the following line

    (New-Object -COMObject Microsoft.SMS.TsProgressUI).GatherLocal()

  43. Click okgather local
  44. Add another “Run Powershell Script” just after the “GatherLocal” Step
  45. Give it a name of “CopyTSBToHdd”
  46. Set Bypass for PowerShell execution policy
  47. Click add script and add the code on the following line

    (New-Object -COMObject Microsoft.SMS.TsProgressUI).CopyTSBToHdd()

  48. Click ok
    CopyTSBToHdd Step
  49. Add a “Set Task Sequence Variable” step just under the “CopyTSBToHdd” step
  50. Name the step “Status 03 (Setup Windows)”
  51. Enter “TSBStatus” for the Task Sequence Variable
  52. Give a value of General,Status03 (This will show the general and Status03 which we saw in the Design Viewer Application
    Status 03 (Setup Windows)
  53. Add a “Set Task Sequence Variable” step just before the application installs
  54. Name the step “Status 04 (Install Applications)”
  55. Enter “TSBStatus” for the Task Sequence Variable
  56. Give a value of General,Status04 (This will show the general and Status04 which we saw in the Design Viewer Application
    Status 04 (Install Application)
  57. Add a “Set Task Sequence Variable” step just before the software update installs
  58. Name the step “Status 05 (Install Updates)”
  59. Enter “TSBStatus” for the Task Sequence Variable
  60. Give a value of General,Status05 (This will show the general and Status05 which we saw in the Design Viewer Application
    software install step
  61. Open SCCM console
  62. Go to \Software Library\Overview\Operating Systems\Boot Images
  63. Right click on “Boot image (x64)” and select properties
    sccm boot image properties
  64. Click the Optional Components tab
  65. Click the sun icon
    boot image optional components
  66. Select “Windows PowerShell” and “Microsoft .NET”
    select optional components
  67. Click ok
  68. Click the customization tab
  69. Tick the box “Enable prestart command” enter “Wscript.Quit(0)”
  70. Tick the box “Include files for the prestart command”
  71. Click browse, browse to the folder where the file “TSBackground.exe” exists
  72. Tick the box “Specify the custom background image file”
  73. Click browse, select the Background.jpg file in the \Packages\TSBackground\ folder
  74. Click ok
    boot image customizations tab
  75. Click apply
  76. Click yes to update distribution points
    distribute optional components
  77. Click Next
  78. Click Next
  79. Click Close
  80. Now run the task sequence on a machine
  81. When it loads you should see it run a new first step as shown below (If this step errors check the fix here)
    run task sequence tsbackgroundinit step
  82. Then it should load the screen we saw in the designer viewer application
  83. Below you can see the progress is on the install OS step, 16% complete and on step 6 of 37
    custom osd background with progress screens step

How To Fix Task Sequence Fails To Run TSBackgroundInit Step

If the task sequence fails on the first step which is running the TSBackgroundInit application this will be because the task sequence can not locate the TSBackground.exe file.

To fix the issue follow these steps

  1. Open the SCCM console
  2. go to \Software Library\Overview\Operating Systems\Task Sequences
  3. Open the required task sequence in edit mode
  4. Click on the TSBackgroundInit step
  5. Click edit script
  6. Find the line Start-Process -FilePath “X:\sms\PKG\SMS10000\TSBackground\TSBackground.exe
  7. And replace it with Start-Process -FilePath “X:\sms\PKG\SMS10000\TSBackground.exe”
  8. Click ok
  9. Click ok
  10. Run the task sequence again

Conclusion

Above I have shown you two ways to set a custom background for OSD (Operating system deployment).

The first method will set a static picture that will not change through out the task sequence, This helps to make the OSD process look a bit more professional as the default look is a bit dull.

The second method is what I personally use on all my builds as it give you a lot of good information about the deployment status.

Leave a Comment