Microsoft’s SCCM 2012R2 comes with WinPE5.0 by default and due to compatibility issues with Windows XP with that version I have proceeded to utilize WinPE3.1. To get WinPE 3.1’s image imported onto the SCCM2012R2 environment several steps had to be taken to extract the file and import the appropriate drivers before being able to re-import it back into SCCM.
These steps are commonly documented throughout various sites, but during my research I did not find many complete guides. My recommendation is to create a Windows 7 virtual machine whose only purpose will be to create and update WinPE boot images. We will start with the following steps as bare minimums:
Downloading & Installing WAIK 3.1
- Download and Install the WAIK 3.0 on this machine.
- Download and mount the supplementary WAIK 3.0 update
- If using virtual machine you can mount the ISO to the virtual CD/DVD drive.
- To install the WAIK 3.1 supplementary update, run command prompt in elevated mode and change directory onto the mounted CD/DVD drive with the following command assuming E: drive is where the CD/DVD was mounted.
- xcopy E:\ “C:\Program Files\Windows AIK\Tools\PETools” /ERDY
- There will be 1131 files that should be copied.
- Now you can launch the “Deployment Tools Command Prompt” as an administrator to begin the creation process.
Creating a Custom WinPE Image
- Once the “Deployment Tools Command Prompt” has been launched as an administrator run the following command:
- copype.cmd x86 c:\winpe_x86
- copype.cmd amd64 c:\winpe_amd64
Note: The copype.cmd batch will create a folder structure under the named destination above “c:\winpe_x86” and “c:\winpe_amd64” with appropriate sub-folders.
- Run the following commands to copy the WinPE base image:
- copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\WinPE3.1_boot_x86.wim
- copy c:\winpe_amd64\winpe.wim c:\winpe_amd64\ISO\sources\WinPe3.1_boot_amd64.wim
- Mount the base Windows PE image using the following command:
- Dism /Mount-Wim /WimFile:C:\winpe_x86\ISO\sources\WinPE3.1_boot_x86.wim /index:1 /MountDir:C:\winpe_x86\mount
- Add the appropriate packages to the WinPE image, we only need three but more are available. The required ones should be added with the following commands:
- Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\winpe-Scripting.cab”
- Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\winpe-WMI.cab”
- Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\<version>\Tools\PETools\<architecture>\WinPE_FPs\winpe-WDS-Tools.cab”
- Verify that the packages were installed by running the following command:
- Dism /image:c:\winpe_x86\mount /Get-Packages
- Finally commit changes to the image by running the following command:
- Dism /unmount-Wim /MountDir:C:\winpe_x86\mount /Commit
Note: Keep track of the “boot.wim” files, name them accordingly to not get the x86 and amd64 mixed up. For example WinPE3.1_Boot_x86.wim and WinPE3.1_boot_amd64.wim will be used as reference from this point forward.
Adding Drivers to SCCM
Adding drivers to WinPE boot images outside of SCCM’s native format is a painstaking process. However, for our needs we needed to add drivers for at least 8 different models. I decided to leverage SCCM by importing each model’s drivers and organizing them through driver packages. This would let me have future usage of the drivers that may be needed in future OS deployments on newer versions of WinPE. If you already have a driver structure configured you may skip this section and go straight into injecting drivers into the WinPE boot image.
- Create a folder in an easily accessible location for SCCM where drivers will be dumped and be used as an import repository, for example:
- Create a folder in an easily accessible location for SCCM where driver packages will be stored and used by SCCM, for example:
- Launch the SCCM Console, within Software Library expand Operating Systems and right click under Drivers.
- Import the downloaded drivers to SCCM leveraging the newly create import repository as the source folder for each Model #.
- Assign the newly imported drivers to a category matching the model # for easier management.
- Create a driver package if it does not already exist and leverage the newly created driver packages repository, where SCCM will store the already processed drivers.
- Repeat this process for all the desired models that will need WinPE 3.1 drivers imported.
- Continue through and finish the wizard.
Adding Drivers to WinPE 3.1 Boot Image
Now that all the drivers have been added onto SCCM, I can maintain the driver’s folder structure where it can allow me to import all of the packaged drivers onto the WinPE 3.1 boot image. This is where I would bring back the Windows 7 VM that was used to create the base WinPE boot image and follow these steps:
- Create a folder on the root of C:\ called WinPE.
- Create three sub-directories called: Images, Offline and Drivers
- Copy the WinPE3.1_Boot_x86.wim file previously saved under C:\winpe_x86\ to the C:\WinPE\Images\ directory.
- Copy all of the processed drivers located under the driver packages directory’s top folder \\SERVERNAME\SHARENAME\OperatingSystems\Drivers\Packages\ to the C:\WinPE\Drivers\ directory.
- To get the WMI file information open a command prompt as an elevated administrator and type the following commands:
- Dism /Get-WimInfo /WimFile:C:\WinPE\Images\WinPE3.1_Boot_x86.wim
- Now mount the wim file and use the name provided from the previous command. It should be something like “Microsoft Windows PE (x86)”
- Dism /Mount-Wim /WimFile:C:\WinPE\Images\WinPE3.1_Boot_x86.wim /Name:” Microsoft Windows PE (x86)” /MountDir:C:\WinPE\Offline
- Inject the drivers to the newly mounted wim file with the following command:
- Dism /Image:C:\WinPE\Offline /Add-Driver /Driver:C:\WinPE\Drivers /Recurse
- Now wait as this process can take a fair amount of time based on the number of drivers.
- Finally get ready to finalize all the modifications and commit the changes
- Dism /Unmount-Wim /MountDir:C:\WinPE\Offline /Commit
- The modified file should reside under the C:\WinPE\ directory and is now ready to be imported as a boot image in SCCM.
Import a WinPE 3.1 Boot Image to SCCM
Finally we can import the modified WinPE 3.1 boot image into SCCM so it can be used for any type of OS deployment on the appropriate machines.
- Copy the WinPE3.1_Boot_x86.wim files to the share location where SCCM can access them in whatever structured mechanism works for you.
- Launch the SCCM Console, within Software Library expand Operating Systems and right click under Boot Images.
- Specify the UNC path for the custom wim file and click next
- Specify the name, version and comments.
- Review the summary and hit next and close.
- Distribute the boot image to distribution servers as needed.
Note: Custom wim files do not have a lot of the properties available to the default WinPE 5.0 boot image.