WaaS IPU - Rollback Recovery Module

So This Post is going to cover the Rollback Recovery Modules that plug into the In Place Upgrade TS.  There are three parts of the process, two Task Sequences parts, and a scheduled task with powershell scripts.

For more info about Roll Back, check out my previous post: Automated Client Recovery from Rollback or OS Uninstall

image

So basically before the upgrade, it copies files (Scripts) into place that it needs to recover from a rollback.  It then also creates scheduled tasks that run on start up that trigger the script.  The script looks for the “RollBack” registry key, if it finds it, it runs the remediation script.

Pre Upgrade:

  1. Deletes Rollback Values from Registry (If the exist from a previous failure)
  2. Makes a Temporary folder %ProgramData%\RollBackRecovery to place scripts
  3. Copies Scripts to Folder
  4. Appends a line to the SetupRollBack.cmd Template file
  5. Creates Scheduled task that will call the script if rollback happens
  6. Creates Scheduled task that will set the Legal Text to RollBack
  7. Creates Scheduled task that will reset the Legal Text to default after Remediation

After the OS is successfully upgraded, it cleans up the scheduled tasks and scripts

Ok, we’re going to step through the Upgrade TS, and I’ll show the Scheduled Tasks created..
image

So the Upgrade TS actually creates all of those, and by the end of the TS, those will all be gone as well.  They are all used for Recovery or Cleanup

Content that pertains to Rollback Recovery:
image

RollbackRecovery = Task that calls script:
image

Script: c:\ProgramData\RollbackRecovery\RollBackRecovery.ps1

image

This script is the brains… does a lot of stuff including copying logs to a network share, so please look at it and update for your environment.  It checks for HKLM:\SYSTEM\Setup\RollBack to know if it should engage or not.  It also leaves “bread crumbs” in the registry to know where the script left off incase the user reboots it while it is trying to recovery the CM Client.

Then there are two Scheduled tasks that deal with the Legal Text
One that set its to “Upgrade Failed, System Rolled Back….” and one that sets it back to your default.

image

It runs at both Startup and when Group Policy triggers… because I don’t want GPO change it back to the default before the user had a chance to read it.

image

The script is simple, it’s just setting those registry keys and logging it.

The next task sets it back to the Default and cleans up the Scheduled Tasks.

image

It Runs at Logon, because I assume if someone logged on, they saw the message and it can now be reset.
The scheduled task & script will continue to run at logon until the RollBackRecovery process has been completed and the WaaS_Stage has been updated to Deployment_RollBack.  Once that happens, then the scheduled task gets cleaned up.  #Magic

image

I hope that clears things up, about how the Rollback Recovery Module works in the WaaS 2.0 Process.  It should help prevent you from find yourself with a messed up client if the setup engine fails and causes a rollback.

GARYTOWN.COM

Leave a Comment

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