Configuring WindowsRE with MDT 2012 Update 1
Updated @ 04/05/2013: Updated script files to include Domain Joined scenario.
I still need to update this post to reflect all the information in this post.
Important note: Thanks to the feedback, an issue has been found when using Windows ADK and deploying these task sequences, I’ve finally pinpointed the cause of the error and will soon update the file package to solve the issue (it has to do with the autofailover ability of Windows 7).
This post is an update of my previous post regarding the Windows Recovery Environment and how to configure it using MDT. My first post was based on MDT2010, this post has been revised to make use of MDT2012 (Update 1). If you’re not very well known with WinRE itself, I would recommend to read my original post regarding this topic: link
I will try to keep this post shorter than the original one, since most of the basics are still the same. Instead what I’ll discuss will be the changes that I’ve made to improve the overall ease of use. The last few months I’ve seen an increased number of emails asking for assistance with my original post on this topic, instead of always trying to help 1 person at a time and try to pinpoint their specific issues I figured I’d just create an update to this that’s less prone to errors.
I’ve spent quite some time in refining the scripts that I’ve used and added some basic logging that should make it easier to identify errors in case one of the tasks fails. I’ve also managed to consolidate all the different batch files, and the different diskpart scripts to 1 single batch file.
So in a bullet point list as of what’s new:
- Scripts are now located in a subdirectory of the %scriptroot% folder named [\WinRE]
- All script files have been consolidated into 1 single batch script [MDT-WinRE.cmd]
- Support for cross-architecture deployments (meaning you can deploy a 64-bit Windows version from a 32-bit WinPE)
- LTISysprep.wsf from MDT2012 U1 has been modified in order to function properly.
- ZTIBackup.wsf from MDT2012 U1 has been modified, this time I’ve taken the time to carefully edit the file and only remove the unneeded sections. It’s no longer a simple rename action of the uselocal variable value in order to force it to use the local disk. All checks are still in place, it will now properly fail before starting ImageX to capture if there’s not enough disk space available to create the .wim file.
- All variables that previously needed to be edited inside the various script files can now all be configured within the task sequence, as task sequence variables.
- Disk Configuration will be handled by the MDT built-in Format and Partition disk step, you can adjust this to your needs.
- I’ve created a Custom Recovery tool for inside Windows RE, this means that the Windows Setup is no longer used for the restore process, but instead ImageX will be used. Using this method will delete all data on the Windows volume, and no “Windows.old” folder will be created.
- I’ve configured a custom hotkey to directly start the custom recovery tool, this is [F1]. You can manually assign a different boot key by editing the MDT-WinRE.cmd script (look for /Bootkey).
- I’ve noticed a lot of people had issues once they had restored their image with a duplicated boot menu entry. This meant that upon startup they would see two identical boot menu entries for Windows 7, adding a boot delay of up to 30 sec. The script that restores the recovery image onto the HDD will configure a new BCD meaning that this issue has been resolved.
- This time I’m also providing a pre-built WinRE.wim for both x86 and x64 machines. Note: these will be driver-less, however they will contain the CustomRE tool and have all the packages as required, you can use as reference to see what I did if you want to create your own. These images are ready to use, unless you need to add drivers, or other language packs since I only choose to use the en-US language.
- The task sequence template has been revised and I’ve updated the descriptions of various tasks.
- It’s now no longer required to use Audit-Mode, hence I’ve removed providing a unattend.xml file; you can use the default unattend.xml file that’s created by MDT.
If you need to use USMT to migrate data from the user profile(s) and possibly even restore it, this is all completely possible, however you will need to add this functionality yourself by adding the proper commands to the scripts.
As for the actual links to the files, scroll to the bottom of this post. They will be hosted on my SkyDrive account, I’ve marked them as public so anyone should be able to download them.
Next I’ll provide some screenshots of how the changes look like.
Below you can see the new Task Sequence, along with the different variables. Important: Do not forget to adjust the Install Image inside the task sequence so it points to one of your own images, when opening the task sequence you will be pointed out there is an error regarding this.
If you want to trigger the recovery environment from within Windows itself, you can do it from within this menu.
After you select the “Return your computer to factory condition” you are prompted whether or not you want to create a backup of your data, regardless of your answer; when you have restored Windows and boot into Windows for the first time, you’re prompted whether you want to restore your files from a backup or not. When you confirm that you want to recover the pc, the pc will reboot right away and start WinRE and load the custom recovery tool. There will be no WinRE menu.
This is the default WinRE menu that is present when you start windows by pressing [F8] and using the “Repair my computer” option. However, now there’s an additional item at the bottom that will be able to start the custom recovery tool.
The HTA that I’ve created that will function as the “front-end” for the recovery process, has been configured to display no borders, and fill the screen. Below is a screen capture from within WinRE. This screen will be started right away without the WinRE menu (previous picture) when you boot the pc and press [F1] or start WinRE from within Windows’s Recovery control panel item.
Once you start the recovery process, it will look as followning.
The message below would be displayed if the recovery process succeeds, if a failure occurs for whatever reason, it will display a message box that will return the error code.
The download link to the script files and TS is the following: http://gallery.technet.microsoft.com/File-package-for-48f074ca
The download link to the WinRE images is the following: http://sdrv.ms/11ylRiY
Please drop me a line through one of the channels to contact me on the [About Me] page whether everything’s working properly or not, this info can help me to make improvements. Next to that it gives me an idea what the interest is in this particular topic.
As for what to do with the files inside the package, it will contain two different folder structures.
The DeploymentShare folder contains the files in the appropriate structure that should be placed inside the root of your deployment share. Note: The task sequence file that I’m providing actually needs to be manually replaced with a task sequence that you create yourself. This means you create a new task sequence, and take note of the TSID you give it, go to the DS\Control\TSID folder and replace the ts.xml file with the one I’m providing. You can see a WinRE folder at the root level of the DeploymentShare folder, I’m using this location as the new default folder that will contain the WinREx86.wim and WinREx64.wim image files (these files are available for download as well), if you do not want to host these files inside the DS, you will need to alter the path for these images in the task sequence variable [RecoveryImagePath].
The WinRE.wim source files folder will contain all the files in it’s appropriate file and folder structure to create the WinRE.wim image manually. This also gives you insight into the specific tasks being executed when the recovery process starts, allowing you to edit this if you need to adjust this. Note: The CustomRE.exe executable is a simple launcher for the RecoveryWizard.hta file, all it does it load a file with that specific name and wait for the process to terminate before it closes itself. This is a requirement because the CustomRE tool defined within WinREConfig.xml has to be an .exe type of file in order to read the product name, and description and the icon, otherwise you might end up with a very weird looking menu entry. The code I used for creating this file is included as well.