Adding BranchCache to WinPE

Before you can use BranchCache in WinPE you need to generate a WinPE image that contains the services and binaries to enable this magic.

Note: If changing or updating the boot image is a major blocker, please contact us.

Generating a new WinPE Boot Image is done via a command line utility (WinPEGen.exe). This utility requires you to have administrator rights on the machine where you run the tool. The reason for this is that it mounts registry hives from the offline media, a privilege that requires administrative rights. In a locked down environment this can be run on a standalone non domain joined computer.

The WinPE images created can then be used as regular boot images in Configuration Manager or MDT (with Configuration Manager). This makes no difference to these processes, they simply have the inbuilt BranchCache & BITS functionality available if called upon.

Prerequisites

Prior to executing the WinPE Generator tool, consider the below prerequisites:

  • WinPEGen.exe should be run on a workstation or server with Windows 10 / 2019 or higher (x86 or x64). The generator does not need to install anything and stores/mounts temporary files in the %temp% folder of the user running the process.

  • The User must be a member of the Local Administrators group. Administrative access is required in order to mount the registry hives in the source and boot media. This is a privileged operation which requires Administrative access to the machine.

  • Access to the 2Pint Software "WinPEGen.exe". This is freely downloadable from the website as a part of the OSD Toolkit.

  • A WinPE image (boot.wim) that has not been finalized (i.e. still allows changes to be made to it). This can be acquired either from the Configuration Manager server or the Windows ADK directly.

  • The Windows installation source media (install.wim) of either Enterprise or Professional editions.

Important: The Windows installation source.wim MUST be the same release version, i.e. same build, as the Boot WIM that is to be modified. If you have a patched install.wim you need to patch your WinPE image. A script to do this can be found here: OSD Toolkit Downloads. Also you have a KB describing how its done: https://kb.2pintsoftware.com/help/generating-the-winpe-boot-image

Note: Although the media does not have to be Enterprise, Professional requires BITS added in order to provide BranchCache functionality. Enterprise media adds native HTTP support for BranchCache.

Using the WinPE Generator Utility

The WinPE Generator tool (WinPEGen.exe) is used to create a BranchCache enabled WinPE image.

WinPE Generator (WinPEGen.exe) Command Line Parameters

Note: The boot.wim file referenced in this process will be modified. It is best practice to make a backup or copy of the original boot Wim.

Mandatory Parameters

The syntax of the WinPE Generator command line parameters is below:

WinPEGen.exe "Source.wim" Index "Boot.wim" Index [Options]

Example:
WinPEGen.exe "c:\temp\install.wim" 1 "c:\temp\boot.wim" 1 

The generator has the following mandatory configuration parameters:

ParameterDescription

Source.wim

The full path and name of the Windows installation source WIM file (install.wim).

Index (source.wim)

The index number of the source.wim to use - Professional or Enterprise.

Boot.wim

The full path and name of an existing WinPE boot WIM file.

Index (boot.wim)

The index number of the WinPE Boot.wim to use.

Optional Parameters

Below is an example of the optional command line parameters:

Example:
WinPEGen.exe C:\Temp\install.wim 1 c:\temp\boot.wim 1 /Add-StifleR /StifleRSource:"C:\Temp\StifleR Client" /StifleRConfig:"C:\temp\StifleR Client\StifleR.ClientApp.exe.Config"

To include the StifleR Client components in the WinPE image:

ParameterDescription

/Add-StifleR

Adds the StifleR client to the WinPE image under the %WINDIR%\System32\ path. If using this option, it is important to add Microsoft .NET Framework support to the boot image in Configuration Manager. See below for how to do this.

/StifleRSource:<path>

Full path to StifleR Client program files from a full Windows StifleR client installation.

/StifleRConfig:<path>

Full path to the StifleR Client configuration file (StifleR.ClientApp.exe.Config).

/Add-StifleROnly

Adds only the StifleR client and does not add BranchCache and BITS to the image.

/Remove-BITS

Removes BITS for Bandwidth Policy Aware Downloads in WinPE. Note: The Windows Source.wim must be Enterprise edition if using /Remove-BITS option, otherwise data transfers will not be BranchCache enabled.

/Copy-BITSPolicy

Copies the local BITS policy into the WinPE Image. This overwrites the default BITS policy which is limited to 1Mb/s during business hours of Monday-Friday 08:00-17:00 and 2Mb/s during any other time. Ignoring speed limits on the LAN allows full throttle download for cached local content. Use GPEdit to create a local BITS policy which can then be copied automatically at build time.

Adding the BranchCache enabled Boot Image into Configuration Manager

Once the new boot image is created, copy it to your Configuration Manage package share. In the Configuration Manager Console, under the Software Library workspace, expand the Operating Systems folder. Right-click the Boot Images, and in the context menu, select Add Boot Image. Follow the "Add Boot Image Wizard" to add the boot image into Configuration Manager.

Once complete, remember to modify your Task Sequences to use the new boot image.

Adding .NET Components to WinPE

If you include the StifleR Client to your WinPE image, you will need to add Microsoft .NET Components to the WinPE Image. This can be done after importing the WIM file into Configuration Manager by opening the Properties of the boot image, selecting the Optional Components tab, and clicking the starburst icon.

At the "Select optional components" pop-up, select the component: Microsoft .NET (WinPE-NetFx) and click OK. Click OK to commit the change to the boot image properties. Follow the prompts to update the boot image and redistribute it to your Distribution Points.

Last updated