Sysprep a Surface Pro 4 and create the WIM image

Par défaut

First you have to install Windows 10 on your Surface Pro 4 (maybe it’s already the case for you)
Then you will have to install what ever you want on that Surface Pro 4 but if you install a program make sure you check the box (if there is one) « Install for ALL users ».

 

Create WinPE Bootable USB Key

Install Windows ADK

Download the Windows Assessment and Deployment Kit here
Launch adksetup.exe
Click Next
Select « No » and click Next
Click Accept
Keep only Deployment Tools and Windows Preinstallation Environment (Windows PE)
adk

Generate WinPE ISO

Press CTRL + R and type « cmd »
Type the following commands in the CMD
cd C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment
For 64 bits:
copype amd64 C:\winpe64
MakeWinPEMedia /ISO C:\winpe64 C:\winpe64\winpe64.iso
For 32 bits:
copype x86 C:\winpe32
MakeWinPEMedia /ISO C:\winpe32 C:\winpe32\winpe32.iso
cmd

USB Key

Now you can download a little tool I use a lot, named Rufus. This tool is useful to create a bootable USB device from an image file like an ISO.
Launch Rufus > Select the ISO > Then change the file system in FAT32.

/!\ You must format the USB key in FAT32 because the UEFI BIOS of the Surface Pro 4 don’t support NTFS (strange right?)

Since we are limited to 5 sysprep maximum per installation I recommend you to try to boot on your freshly created USB Key just to be sure you will not missed the start after the sysprep.

Sysprep the Surface Pro 4

In Windows now go in C:\Windows\System32\sysprep\
And launch sysprep.exe
Check the box « Generalize » and change the Shutdown Options to « Shutdown »
sysprep
Now you can click « OK ».

If you are lucky it will work at the first try. If not, you are like me.

The error

Sysprep was not able to validate your Windows installation. Review the log file at %WINDIR%\System32\Sysprep\Panther\setupact.log for details. After resolving the issue, use Sysprep to validate your installation again.

Go check the log file

First error log

Bitlocker-Sysprep: Bitlocker is on for the OS volume. Turn Bitlocker off to run Sysprep.

It means that Bitlocker is active for a part of the OS. (Even if you didn’t turned it on)

Fix:

  1. In the Start menu search for « Powershell »
  2. Click right on it and « Run as Administrator »
  3. manage-bde -off C:
  4. Wait for Bitlocker to finish to decrypt the drive
  5. Try the Sysprep again

Second error log

Package king.com.CandyCrushSodaSaga_1.62.900.0_x86__kgqvnymyfvs32 was installed for a user […]

Again even if you didn’t installed the application you have it in the retail Windows 10 iso.

Fix:

  1. In the Start menu search for « Powershell »
  2. Click right on it and « Run As Administrator »
  3. Import-Module Appx
  4. Import-Module Dism
  5. Get-AppxPackge -AllUser | Where PublisherId -eq kgqvnymyfvs32 | Format-List -Property PackageFullName,PackageUserInformation
  6. Copy the PackageFullName
  7. Remove-AppxPackage -Package PackageFullName
  8. Try the Sysprep again

In my case I had to do this step again for com.Twitter_5.0.0.0_x86__wgeqdkkx372wm

Fetch the Windows 10 WIM image

Now your Surface Pro 4 is shutdown (don’t start it yet or you will have to do the sysprep again!). Plug-in the WinPE USB Key to the Surface Pro 4 or to his Microsoft Dock (both works).

Press the Volume-Down key and press the power button. Once you see the Surface logo you can release the Power button but keep the Volume-Down pressed. Then the surface is starting WinPE. You should see a command line interpreter.

At that moment X: is your currently running WinPE and C: is your Surface Pro 4 system drive.

In my case I plugged-in a second USB Key (E:) formatted in NTFS (to not be blocked by the 4GB size per file of the FAT32)

Type:
dism /capture-image /imagefile:E:\Surface.wim /capturedir:C:\ /name:Windows

Wait for the end of the capture and type exit

Now you have a beautiful Surface Pro 4 image and you can use it with SCCM for example and it will works perfectly 😀

Une réflexion au sujet de « Sysprep a Surface Pro 4 and create the WIM image »

  1. carmelo

    Hi Thnx for the info.
    As I already deleted the Candy Crush game, I had this Sysprep error for the App: Freshpaint. Deleted that one too and the sysprep worked just fine as you described 😉
    After it turned off and booting up in the WinPE, it automatically tries to boot through PXE over IPv4.
    I just want to recommend plugging out the network cable when doing so, then you’ll get to the cmd prompt

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Time limit is exhausted. Please reload CAPTCHA.

https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_bye.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_good.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_negative.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_scratch.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_wacko.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_yahoo.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_cool.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_heart.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_rose.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_smile.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_whistle3.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_yes.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_cry.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_sad.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_unsure.gif 
https://root.sx/wp-content/plugins/wp-monalisa/icons/wpml_wink.gif