Prevent use of computers which failed during OSD

Sometimes an OS deployment fails for different reasons, one thing that can be a problem is that users in some cases don’t see the error message saying that the installation failed and starts using the computer. Even if we use “SMSTSErrorDialogTimeout” to change the default 15 minutes error dialog to 22 hours, the installation can be initiated over a weekend for instance.
If the installation fails near the end of the Task Seqeunce it could only be one application missing an nobody notice it.

I have written two small scripts for this, one that actually disables the computer account in AD if the TS fails and one that changes the logon background in Windows 7 to an awful looking background which cannot be missed by the user, of course this is just a sample.
If the Task Seqeunce fails it would look like this if the user tries to logon:


Then no user cannot use the computer for sure.
I use it in an MDT task sequence so I put the two additional steps in the section “Gather Logs and StateStore on Failure” which is executed in case of a Task Sequence failure.

Here is how to implement it:

  1. Download the scripts needed here: TSerrorscript
  2. Place them in a folder that can be used as source folder as below.
  3. In the backgrounds directory replace my ugly example logon background with your own.
  4. Create a package in Configuration Manager with the folder with the scripts as source folder and distribute it to your DP’s.
  5. In the Task Seqeunce add a step for disabling the computer account. I use the same account as I use to join the domain.
  6. Set a condition to only run if not in WinPe as there is no account to disable if the computer is not in AD.
  7. Then we add a step to change the background and use the same condition as above for this step.
    DisableComputer7That is it, now you are ready to test it out.


Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.