A couple years ago I was working on a project on which I was responsible to set-up an OS Deployment using SCCM (at that time 2007R2). We wanted to deploy multiple workstations at once and we wanted to implement a solution to easily see that the installation was successful. The only requirements I received were: it should be visible & easy to understand…
I’ve created a solution already in 2011, but I thought that it was just a temporary solution untill we found a better way. The implemented solution is still in use by that customer. In fact this solution now is used in several big companies in the Netherlands and still colleagues are asking me to share the solution! So I think it’s time to share my solution with you all 🙂 Please do remind this is only tested on Windows 7.
When using an OSD (Operating System Deployment) and the deployment is succesfull, you will see the Windows logon screen, so that the user can start logging on. When an OSD is unsuccessful, SCCM shows you the error of the failed task for a maximum of 15 minutes. After that it will stop the OSD and start the computer, ending the OSD by showing the Windows logon screen. This Windows Logon Screen looks always the same by default and therefore you cannot see if the OSD was successful or not!
So what can (and did happen): One of my customers noticed that the installation of several computers was finished quickly and successful, as they could see the logon screen. After some checks they found out that they were missing software…..
So how to be sure the installation is successful?
The solution I thought of is a colorful logon screen at (first) logon:
GREEN: Installation successful
RED: Installation Failed
Orange: Installation errors! (I used it when the computer was not in the correct OU)
To make these colorful screens available I created 3 scripts and of course I also created the background images. Create a folder on the same level as the install.vbs. The naming of the folder should always be “backgrounds”!
Within the “backgrounds” folder add the background images and a batch file (will be explained later in this post):
The first script (install.vbs) will make sure that the files will be copied to the correct local folder and that the default logon background will be changed. Add this script in the Task Sequence, directly after the SCCM client is installed!
This step also can be done within the WIM image, but I prefer to keep the WIM image as default as possible.
' Name : install.vbs
' Author : Ruben Koene / www.rubenkoene.com
' Reviewer:
' Version : 1.00
' Original Date : 04-10-2011
' Change Date:
' Description: Script to set Logon background wallpaper
'---------- Setting computervariables ----------
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
strScriptpath = Left(wscript.ScriptFullName,InStrRev(Wscript.ScriptFullName,""))
sBackground = "C:\Windows\System32\oobe\Info\backgrounds"
'---------- Create local folder and copy files to local folder ----------
If Not objFSO.FolderExists("C:\Windows\System32\oobe\Info") Then objFSO.CreateFolder("C:\Windows\System32\oobe\Info")
objFSO.CopyFolder(strScriptpath & "backgrounds",sBackground,TRUE)
'---------- Set Logon background wallpaper ----------
objFSO.CopyFile "C:\Windows\System32\oobe\Info\backgrounds\sccm_deployment.jpg","C:\Windows\System32\oobe\Info\backgrounds\backgroundDefault.jpg",TRUE
objshell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BackgroundOEMBackground","1","REG_DWORD"
When this script has run, the “backgrounds” folder is copied local to “C:\Windows\System32\oobe\Info” and the file “sccm_deployment.jpg” is copied as “backgroundDefault.jpg” in the same folder making the red screen the default logon background.
When the Task Sequence now fails, the default background always is the red “failed” screen! 🙂
At the end of the Task Sequence I’ve added another script (check.vbs). Within this script you can add any check you want and based on the outcome, you put in the background image you prefer. For this blog I’ll only keep it to the “green” OK background image:
' Name : check.vbs
' Author : Ruben Koene / www.rubenkoene.com
' Reviewer:
' Version : 1.00
' Original Date : 4-9-2013
' Change Date: -
' Description: Script to check OU membership and sets OK/NOK Logon background wallpaper plus creates scheduled task to change Logon background wallpaper back to default after deployment is done
'---------- Setting variables ----------
set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")
'---------- Set Logon background wallpaper ----------
objFSO.CopyFile "C:\Windows\System32\oobe\Info\backgrounds\sccm_deployment_OK.jpg","C:\Windows\System32\oobe\Info\backgrounds\backgroundDefault.jpg",TRUE
'---------- Create Scheduled task ----------
objShell.Run "schtasks /Create /RU system /SC ONLOGON /TN STATUS /TR C:\Windows\System32\oobe\Info\backgrounds\remove_task.cmd"
When this script has run, the file “sccm_deployment_OK.jpg” has overwritten “backgroundDefault.jpg” in the same folder making the green screen the default logon background. It also creates a Scheduled task which will run under the SYSTEM account at logon. The Scheduled task will run the batch file (remove_task.cmd) which is copied with the install.vbs.
REM Name: remove_task.cmd
REM Author : Ruben Koene / www.rubenkoene.com
REM Reviewer:
REM Version : 1.00
REM Original Date : 4-9-2013
REM Change Date: -
REM Description: Script to remove the created Scheduled task and the OEMBackground reg-key
@echo off
cls
schtasks /Delete /TN "STATUS" /F
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background /v OEMBackground /f
After logon the remove_task.cmd script will run and will remove the scheduled task. It also removes the OEMBackground key, which was earlier created in script: install.vbs.
From that moment, the logon background is back to normal again.
Hope this blog is useful and please let me know if you have other suggestions! last but not least: I’ve used this in a SCCM environment. Of course this solution is not limited to SCCM only, but can also be used in other deployment mechanisms…. So, hopefully soon every office is as colorful as the background images I used 🙂
Update:
Just to make it more easy, you can download the scripts here
6 comments
Skip to comment form
The download link seems to be broken?
Author
Fixed! Thanks for informing!
Hi Ruben,
Thanks for the post.
In my case I have added the Red screen wallpaper in the .wim file
C:\Windows\System32\oobe\info\backgrounds\RedSCreen,jpg
Modified the registry settings in .wim file.
HKLM/Software/Microsoft/Windows/CurrentVersion/Authentication/Logon/UIBackground
and OEMBackground as 1
Could you please let me know how to use your script and add Task Sequence step in this case ?
Thanks,
Author
Hi Karthik,
I’m assuming you are using Win7?
If so, please rename the RedSCreen.jpg to backgroundDefault.jpg. This is the default name Windows 7 is using.
If you have the red screen in place, including the reg key (which you have in the WIM), then you only need to replace the redscreen with a green screen (or any other color) at the end of the task sequence, or remove the regkey so that you have the default Win7 logon page.
If you want a temporary green screen, then download my script (attached to the blog) and use Check script. It creates a scheduled task, which will remove itself and the green screen when you logon the first time.
Hope this helps! good luck!
Thank you Ruben !!
I have renamed red-screen.jpg to backgroundDefault.jpg in the .wim file.
Now ,my requirement is to set the red screen.jpg as background if the Task Sequence fails at any stage.If the Task Sequence is successful it should set the default Win7 background.
How to achieve this ? Any help would be appreciated.
Thanks,
Author
Hi Karthik,
Please download the zip that I’ve made available in the blog post, it contains my package with scripts that I’ve used.
Create a task in the OSD Task Sequence (I’ve used a Command-line) and put it as the last task in the Task Sequence. Added the package which contains the script and in the command-line add the following: cscript check.vbs.
This script will replace the red screen with the green screen (which is also in the zip).
Currently I don’t have a test environment with Win7 available, as I’m working on the Win10 version of the script (post will come soon)
Hope this helps!
Regards, Ruben