Adding BranchCache to WinPE
Last updated
Last updated
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.
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.
The WinPE Generator tool (WinPEGen.exe) is used to create a BranchCache enabled WinPE image.
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.
The syntax of the WinPE Generator command line parameters is below:
The generator has the following mandatory configuration parameters:
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.
Below is an example of the optional command line parameters:
To include the StifleR Client components in the WinPE image:
/Add-StifleR
/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.
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.
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.
Note: This section only applies if you used the /Add-StifleR and /StifleRConfig:<path> options with WinPEGen.exe.
When a mandatory task sequence deployment is targeted to a PXE or Media booting client, prior to the task sequence starting, a "Mandatory Task Sequence Warning" countdown dialog is displayed to the user before the task sequence deployment starts.
This dialog box can be suppressed / skipped by modifying the StifleR.ClientApp.exe.Config file that is specified in the /StifleRConfig:<path> parameter for WinPEGen.exe.
Under the <appSettings> section in the StifleR.ClientApp.exe.Config file, add the following line:
After saving the file, when you run WinPEGen.exe, the boot image will include the file and if present, the Mandatory Task Sequence Warning dialog will be suppressed.
If the boot image has already can be created, and the StifleR Client has included in the boot image, you can edit the .config file after the fact by mounting the boot image, and editing the .config file under: <MountDirectory>\Program Files\2Pint Software\StifleR Client\StifleR.ClientApp.exe.Config
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 for how to do this.