By Kari the Finn, guest blogger for Ed Tittel, courtesy of TenForums.com
Note: this blog is Part 4 in a series of 6 parts on the topic of using Sysprep to craft a custom ISO for use in installing Windows 10, aimed at the upcoming Creator’s Update scheduled to become available in mid to late April. Your guest blogger for this series is Kari the Finn, well-known Windows Install expert at TenForums.com. He’s the person who put tools together (ESD2ISO and UUP2ISO) that let savvy installers convert Windows OS download files into ISO images that may be used to create bootable installation optical media or USB Flash Drives. Part 1 covered the intro, and Part 2 started users with installation prep; Part 3 explains how to update and customize Windows; here’s Part 4, which digs into generalizing a Windows image using the Sysprep utility. Don’t let the numbering bother you (Part 1 was an introduction, so step 1 appears in Part 2, step 2 in Part 3, and so on…)
3. Generalize Windows image with Sysprep
OK, in the grand scheme of this 6-part behemoth, we’re almost there. One small but important detail must be addressed before we can run Sysprep: we must create a partition on our Hyper_V VM to store a captured Windows image. If you are using a physical PC as the technician machine this is unnecessary. Instead, you can simply use an external HDD or flash drive to store that image.
Disk Management Detour Explored and Explained
Open Disk Management and shrink the original C: partition to create free space for a new partition in which to capture a Windows image. It needs to be big enough for the install.wim file we capture later. For example, my usual custom Windows 10 PRO x64 ISO includes the following software pre-installed: Office 365 Business, Macrium Reflect, Opera, Chrome, Firefox, VLC Player, Adobe Reader, MalwareBytes, TeamViewer, 7Zip, Notepad++, plus other software that varies from build to build. As described, this results in an install.wim file that’s between 5 and 6 GB in size. To compensate, I usually subtract 10 GB (10240 MB) from C:. That’s plenty for most users. When I’m done, I create a new partition using that freed space, and format it NTFS.
Exit Disk Management. To help us to identify key partitions later, please rename the system drive C: to Windows and the new partition (in this case it became the E: drive) to Image or any other distinctive name. Create a new folder on the new capture drive (E:) named Scratch. We will need it when capturing the image as a temporary working folder using the DISM command (covered in Part 5).
Getting Ready to Run Sysprep
If you are running a Hyper-V VM, create a checkpoint now. If you are using another virtualization program create a snapshot. If using a physical PC, I recommend creating a system image now. Checkpoints and snapshots take just a minute, imaging a physical PC a bit longer. That’s one important reason I always use Hyper-V. Later when I want to let’s say update my image I simply restore this checkpoint created just before sysprepping Windows, then modify that image before running Sysprep again.
Check that the built-in admin’s (current user) Downloads folder is empty, that no software installers or assets are left there. Run Disk Clean-Up to remove all temp files, Recycle Bin content and so on.
Get Your Sysprep On
OK, now it’s time to run Sysprep. Open the Command Prompt, it will be automatically elevated because you are signed in using the built-in administrator account. Run the following command:
%windir%\system32\sysprep\sysprep.exe /generalize /oobe
This command runs Sysprep with Generalize and OOBE switches and then shuts down. The Generalize switch removes all hardware related information such as drivers and registry entries, resets Event Viewer, removes all shadow copies (restore points), and disables the built-in administrator account.
The OOBE switch forces Windows to run its setup phase the next time Windows boots from this image, as if it were a normal Windows setup. Because Windows was generalized a new unique SID (GUID) will be generated for each such installation.
Sysprep reads the answer file unattend.xml from C:\Windows\System32\Sysprep folder. In our case its most important line reads <CopyProfile>true</CopyProfile>. When true, CopyProfile copies all our customizations and personalizations to the default user profile, in the hidden folder Default in the Users folder. That profile is used as the base profile whenever a new user account gets created.
This concludes Step 3 of the process, and concludes Part 4 of this six-part blog post. Part 1 covered the intro, and Part 2 started users with installation prep; Part 3 explained how to update and customize Windows. Here in Part 4, we dug into generalizing a Windows image using the Sysprep utility. Part 5 picks up with capturing our custom Windows image to create an ISO, and Part 6 describes how to update and/or change that ISO to conclude this series. Look for those posts to follow here soon!
Links to All Series Parts (1-6)
Part 1: Introduction & Overview
Part 2: Install Windows and Prepare Assets
Part 3: Update and Customize Windows, Install Software
Part 4: Generalize Custom Windows Image with Sysprep
Part 5: Capture Custom Windows Image, Create ISO
Part 6: Update/Change Custom Windows ISO