A common challenge with Windows 10 Upgrade task sequences is handling user logins if there are any restarts during the task sequence. After the restart happens, a user can log back into the system but has no way of knowing that a background process (the upgrade task sequence) is running. Additionally, after the user logs in, the task sequence progress bar may take a while to be shown again (or may never reappear). This isn’t initially a problem but will quickly become an issue when the task sequence restarts the system again and gives the user little to no warning. Think of calls for iron maidens and execution by the users for the perpetrator of such an injustice; i.e., you.
So this first begs the question of why you would have a restart in an upgrade task sequence in the first place. There are many valid reasons, and all of them are indicative of why most folks choose to use a task sequence to roll out their feature updates instead of servicing. Here are a couple that I’ve seen and used:
- Software uninstallation that requires a reboot; e.g., third-party anti-virus.
- Dropping to WinPE to switch the install language.
Addressing the Challenge
There is no graceful solution here. Gary Blok presents one possible approach to addressing the challenge in his blog post Change Lock Screen & lockout users during Upgrade TS. There are potential problems with this approach though like GPOs overwriting these settings. Not being able to directly log into a system if you need to troubleshoot issues if (or when) they happen is another shortcoming. I’m not discounting Gary’s solution at all, just providing an alternative (or possibly a supplemental approach) if his approach won’t work in your environment.
My approach at a recent customer for this challenge — because they had GPOs in-place that would prevent Gary’s method — is to display a message to the user when they log in while the TS is still executing. To do this, we first need to create a pop-up message of some sort. Luckily, UI++ is perfect for this. To have UI++ pop-up and show the user a warning message, we need to first copy the necessary files locally, and then add the appropriate command-line as a value to the Run key for every existing user as well as the default user (in case a new user logs in).
Here’s a basic “warning” message for the end user. This, of course, is completely customizable.UpgradeInProgess.xml
Copying the Necessary Files
For this simple task, I used a previously posted script of mine from Copying Files to Clients Using ConfigMgr with one additional command added at the end to call the next script which adds the Run registry value to every user’s profile. Here’s the slightly modified version:configure.bat
Configuring the Run Value
This script is a follow-up to my post on Copying Files to Every User’s Profile; instead of copying a file to every user’s profile though, it sets or adds a registry value in every user’s profile. In this case, it adds a value to the Run key so that the message above is shown every time that a user logs in. This script deserves a post of its own, but for now, here it is.UserProfileReg.bat
Removing the Run Value
Once the task sequence is finished (or almost finished) we need to stop the notice from being displayed at login. For this, a slightly modified version of the above UserProfileReg.bat file will do the trick.RemoveUserProfileReg.bat
Putting it All Together
- Create a folder in your source repository; e.g., Win10UpgradeNotice. This will be the source location specified for a new package.
- Copy configure.bat to the Win10UpgradeNotice folder.
- Create a subfolder in Win10UpgradeNotice called Content.
- Copy UpgradeInProgess.xml, UserProfileReg.bat, RemoveUserProfileReg.bat, and UI++.exe to the Content subfolder. (UI++ is available from the UI++ page.)
- Create a package specifying the UNC for the Win10UpgradeNotice folder in your source repository.
- Create a run command-line task in the task sequence (near the beginning after any initial pre-flight checks).
- Reference the package created in step 5.
- Specify the following Run command-line:
- Create a run command-line task in the task sequence (near or at the end).
- No package needed.
- Specify the following Run command-line:
Step 6 above configures the heart of this process. Here’s a brief description of what happens when configure.bat runs in this step.
- It copies the files from the Content subfolder to a new subfolder of C:\Windows\Temp called Win10Upgrade (you can, of course, change this if you wish by modifying the command-lines in steps 8 and 7 above).
- It then calls UserProfileReg.bat to register the UI++ the command line in the registry of every user to display the message whenever a user logs in. This command-line is embedded in the UserProfileReg.bat:
cmd.exe /c start /D %DEST% UI++64.exe /config:UpgradeInProgress.xml
A few notes on this command-line
- cmd.exe is used because start is a command-shell command. The /c switch tells cmd.exe to run the command specified after it and then exit.
- start is used to specify a working directory (using the /D switch) so that relative paths can be used to specify the configuration XML file and within the configuration XML file.
- %DEST% is passed to UserProfileReg.bat by configure.bat and is the path specified on the command-line in step 6 above. If you wish to change this path, simply change it in steps 6 and 7 above.
As noted previously, there are no perfect solutions to the problem presented, but this one met the needs of my previous customer. The above can also be adapted for other scenarios and the scripts used for other purposes.