Customize WinPE
Host Provisioning WinPE Preparation Tool allows you to customize your WinPE image with several options.
C:\WinSource will be used as the directory in the examples, replace it with the directory you choose.
Parameters
Parameter | Description |
---|---|
-w, --WindowsSource | Required. Full path of Windows installation image WIM, typically C:\WinSource\sources\install.wim |
-p, --WinPESource | Required. Full path of a Windows boot image WIM, usually C:\WinSource\sources\boot.wim. If you use winpe.wim from the ADK PE module you will get a more optimized image but you must download exactly the same version as the Windows ISO you are using. Check ADK versions |
-d, --DstFolder | Required. Path to the folder where the resulting deployment image will be created, for example C:\HpsImage |
-i, --IndexWindowsSource | An install.wim image can contain several images, set the index of the one you want to use, if not set all images will be checked until a compatible one is found (recommended) |
-j, --IndexWinPESource | A boot.wim image can contain several images, set the index of the one you want to use, if not set all images will be checked until a compatible one is found (recommended) |
-a, --ADKPath | ADK installation path, the tool will try to detect the path automatically, you can set the path if it's not detected. ADK is needed to further customize the WinPE image |
-o, --CreateIsoPath | In addition to a .WIM image compatible with PXE network systems, an ISO will be created which can be mounted on virtualization systems or a USB drive. Specify the full path where you unzipped the installation Windows image, for example C:\WinSource |
-u, --IsoUEFISector | The created ISO will use a UEFI boot sector, if not specified a BIOS boot sector will be used |
-x, --Support802x | Include the WinPE package for environments requiring 802.x. ADK is needed for this. Customize the eap_profile.xml and eap_creds.xml configuration XML files to support your environment |
-b, --KeyboardLayout | By default, the keyboard layout of the image will be used, you can change it by entering the layout code of a country, for example for en-US enter 0C0A:0000040A, for es-ES 0C0A:0000040A check here for the code of your country |
-t, --TimeZone | Sets the timezone during deployment, if not established the timezone from the computer running the tool will be used, check this to see the available time zones. Use the long text format like "Romance Standard Time" |
-f, --Force | Ignore different versions in WinPE and Windows installation ISO, it is recommended to use install.wim and boot.wim images of the same Windows image. This option may create a non-bootable image |
-m, --DoNotCopyUSMT | Do not copy User Migration Tool x64 (USMT) files, optionally used to migrate user and apps settings when applying a new VHDx file |
-s, --HpsServer | Set the default server that will appear on the deployment server name. Default is https://hps |
-b, --BroadcastPort | Set the broadcast port used by the deployer to discover a Host Provisioning Server. This value must match the global setting configured in Servers. Default is 8888 |
-z, --DebugOnDeployment | When set, the deployer will write to log in debug mode, useful when troubleshooting |
Examples
This example builds an image with the minimum required parameters. A Windows installation media has been unzipped in C:\WinSource and we are using the install.wim and boot.wim files from that image. It also creates a bootable ISO media.
HostProvisioningWinPE.exe --WindowsSource C:\WinSource\sources\install.wim --WinPESource C:\WinSource\sources\boot.wim --DstFolder C:\DestinationFolder --CreateIso C:\WinSource
This example builds the lightest image using the Windows PE provided by Microsoft's ADK suite. A Windows installation media has been unzipped in C:\WinSource and we are using the exact install.wim version that matches the WinPE's ADK version, this can be tricky because you need to have the matching Windows installation media, check ADK versions page for more information. It also creates a bootable ISO media with UEFI sector and sets the time zone to Paris/Madrid and keyboard to es-ES. A default Host Provisioning Server is set to http://MyServer.hps.net.
HostProvisioningWinPE.exe --WinPESource "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\en-us\winpe.wim" --WindowsSource C:\WinSource\sources\install.wim --DstFolder C:\DestinationFolder --CreateIso C:\WinSource --IsoUEFISector --TimeZone "Romance Standard Time" --KeyboardLayout 0C0A:0000040A --HpsServer http://MyServer.hps.net
Optional: Add support for 802.1x
If you need the deployment image to support 802.1x authentication on switches you will need to install the 802.1x package from Microsoft, follow these steps:
-
Download from the Microsoft website the PE add-on module, choose the version of ADK/PE for Windows 10/11 depending on the version of the ISO image you have.
-
Install the WinPE module for Windows ADK that you have downloaded (adkwinpesetup.exe). It consists of a single package.
-
Modify the 802x EAP configuration .XML files with the configuration of your environment, you have two files with a sample configuration on the Host Provisioning Preparation Tool unzipped folder.
-
Prepare the image by specifying the
--Support802x
parameter, the XML files must be placed on the existing 802.1x folder with the same nameseap_profile.xml
andeap_creds.xml
.
Credentials for EAP-MSCHAP authenticatication with 802.1x switches might be stored in plain text in the eap_creds.xml file, access to this file should be restricted, an ad-hoc user with no other permissions should be created.