Go to ...

RSS Feed

Windows Deployment with MDT – Part 4: Capturing WIM, In-place Upgrade


In Part 3, we customized the deployment image by modifying our answer file, INI files and adding software. But there’s another method, one I personally prefer you could use to proceed . My personal preference is to capture a custom image from a reference machine, and then import that captured custom WIM file to MDT and use it for deployment. In this part of this series we will do just that.

Install & Customize Windows

Start by installing Windows 10 on a reference machine. You can use any machine, physical or virtual. I always use Hyper-V virtual machines as reference machines, where temporary virtual machines let me build a completely customized image.

While Windows is installing on your reference machine, create a new Task Sequence as in Part 2. This time, select Sysprep and Capture from the dropdown list in the Select Template page for the New Task Sequence Wizard:

Select the operating system and other options exactly as you did when creating a task sequence for deployment.

IMPORTANT:

In Part 3 we automated the deployment task by editing the CustomSettings.ini file. If left as-is, when we run the MDT script on our target device, it will automatically start a new OS deployment. Instead of capturing a custom image from the reference machine, its OS would be completely wiped and replaced with a clean install. We must edit the CustomSettings.ini every time before Capture or Upgrade tasks are run on target devices.

The following text block captures all the edits I made just now to the CustomSettings.ini we created in Part 3. I changed two YES values to NO in two lines (blue highlight). Also, I added a semicolon followed by a space to the beginning of the TaskSequence line (red), and to every Applications00X line to avoid unnecessary reinstall of applications. A Semicolon flags its line as a remark or comment, which is then ignored when the task is run:

[Default]
OSInstall=Y
_SMSTSORGNAME=Win10.guru
SkipAdminPassword=YES
SkipCapture=NO
SkipApplications=YES
; Applications001={a6a564c5-4c2c-41e8-9f68-c13d9b63ecd8}
; Applications002={38b1a9d8-c8b6-405b-b40d-27794c9c3a99}
; Applications003={9ba3ae8a-856b-4f39-9a69-95f307309d3a}
; Applications004={32ce5ae2-ffa7-4770-a6ff-4b8c6958dee8}
; Applications005={afde4f64-9e61-4c2f-958f-b553ff90f2d2}
SkipBDDWelcome=YES
SkipTaskSequence=NO
; TaskSequenceID=DEP01
SkipBitLocker=YES
SkipComputerBackup=YES
SkipComputerName=YES
SkipDeploymentType=YES
SkipDomainMembership=YES
SkipUserData=YES
SkipLocaleSelection=YES
SkipProductKey=YES
SkipSummary=YES
SkipTimeZone=YES
EventService=http://AGM-W10PRO03:9800

When the reference machine finishes Windows Setup and boots to the OOBE showing  the region and language selection screen (see following screenshot), press CTRL + SHIFT + F3 to restart it in Audit Mode, a special Windows customization mode:

Windows boots to Audit Mode using the default built-in admin credentials.

Customize Windows as you like: install software, change settings, and so forth. Notice that because the reference machine is at this point not activated, personalization settings cannot be changed. Workaround: to change theme and colors, copy an earlier exported Windows Theme file to the reference machine and apply that theme.

Capture the custom WIM

When finished, do not sign out / restart / shut down. While still in Audit Mode, signed in as built-in admin, open File Explorer on the reference machine. Then, select This PC (#1 in screenshot), select Computer tab (#2), and select Map network drive (#3). Enter the network path to your deployment share (\\server\share, #4), unselect Reconnect at sign-in (#5), select Connect using different credentials (#6), and finally click Finish (#7):

Enter the network credentials to access your deployment share on the MDT Workbench machine. Open the mapped deployment share in File Explorer, browse to the Scripts folder and run the script LiteTouch.vbs. Be sure to run the VBScript file (.vbs), not the Windows Script File (.wsf)! This is a seemingly minor but important difference:

The script runs the Deployment Wizard on the reference machine. Sign in to the deployment share using your MDT Workbench admin credentials, and when prompted, select your new capture Task Sequence:

Click Next and start the capture process. The reference machine will run Sysprep:

After Sysprep, the reference machine restarts to WinPE to capture the WIM image:

If the capture process issues any errors or warnings, check those details to see if there’s reason for concern. Warnings are usually not serious, like this warning I show in the following screenshot. In this case, the image was OK when used for deployment:

By default, you’ll find captured images in the Captures folder in your deployment share. You can now import it as an OS to the deployment share, selecting Custom Image File as described in Part 2, and deploy it to other machines.

Upgrade the target device

I want to upgrade some physical and virtual machines to the latest Windows Insider Skip Ahead build (18865 when writing this). To do that, I must first mount build 18865 ISO and import it to the deployment share as described in Part 2. The next step is to create a new Task Sequence as explained in Part 2,  this time selecting Standard Client Upgrade Task Sequence on the Select Template page, and thereafter selecting Insider build 18865:

On the target machine, sign out from your current account and sign in to the built-in admin account. Map your deployment share on the MDT Workbench machine as a network share and run the LiteTouch.vbs script as described earlier in this post. Select the upgrade task:

The upgrade will then start . Be patient: the progress bar stands still for quite a long time. In fact, an upgrade can take anywhere from 15 minutes to over an hour to complete, depending on your hardware:

Running the MDT upgrade task on a target device is and does exactly the same as when running the same upgrade locally on the target device from Windows install media.

That’s it!

Parts in this series:
Windows Deployment with MDT – Part 1: Setup
Windows Deployment with MDT – Part 2: Deploying Windows
Windows Deployment with MDT – Part 3: Customize Deployment
Windows Deployment with MDT – Part 4: Capturing WIM, In-place Upgrade

Kari

Author: Kari Finn

A former Windows Insider MVP, Kari started in computing in the mid 80’s writing code for VAX / VMS systems. Since then, he’s worked in a variety of IT positions. He specializes in Windows image capture, customization, repair and deployment as well as Hyper-V virtualization. Kari is a proud Team Member at number #1 Windows site TenForums.com.

Leave a Reply