Before you even start the WinPE process below, it's best to determine if WinPE is the better choice or if you should have a Microsoft Deployment Toolkit Server. Each path will give you similar results, but really you want to choose a path depending on your need.
As an IT Consultant I've used both, Microsoft Deployment Toolkit is great for large clients that have specialized software, the money to support the network/server and you are a full time employee there. WinPE on the other hand is best used for IT Consultants with small to medium size clients as it provides a more universal approach. You can easily prepare an image ahead of time and take it with you/apply it on the fly.
Here is an example of a real world deployment scenario I was apart of a while back and why it worked so well;
During a major overhaul at KJLH in Compton CA, I oversaw the deployment portion of swapping 35 old computers with Windows XP installed, to brand new hardware with Windows 7. The internet at the time was very poor and all of the server hardware could barely keep up with it's current usage. I was in charge of deciding the best way to complete this mass deployment within a few days. So i opted to use WinPE, with two scripts. One to start the imaging process, and one bypass the setup screen and to install some additional software. After spending some time with the employees and obtaining information regarding the day to day process, I was able to record and duplicate all installs, configurations and ‘specific’ work arounds for compatibility issues within a single system. I then captured it and tested it ahead of time. On the day of deployment, I brought a system ready to go with a share location, all scripts, installs and image, along with a router for DHCP services and 24 port gig switch. Within an hour and 30 minutes all 35 new computers were imaged and ready to be deployed and that includes the time it took to setup all of the imaging hardware and cabling.
If WinPE sounds like the route for you, then continue on. If you would prefer to setup Microsoft Deployment Toolkit, click here: https://docs.microsoft.com/en-us/windows/deployment/deploy-windows-mdt/get-started-with-the-microsoft-deployment-toolkit
Customized WinPE ISO/USB Device creation
Setting up a customized WinPE ISO/USB Device is very easy, especially with the script below, as it will do everything for you. The difficult part is setting up the scripts to use once inside WinPE. Give yourself time to learn the system and commands. The goal with WinPE is consistency. Meaning if you want to use an external drive or network drive to store your images, always mark it as the same letter. If a computer has multiple hard drives, always unplug the secondary drive. If you deal primarily with newer systems, stick with UEFI so you don’t have to go back and forth between MBR and UEFI and all the different commands between them.
Install AIK
Install the latest edition of AIK and WinPE addon from here: https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install
Create folders to keep everything organized
C:\WinPE
C:\WinPE\Drivers
C:\WinPE\mount
C:\WinPE\Scripts
Download Drivers for WinPE
I would highly recommend using Dells WinPE Driver package as your main driver source, it’s very well put together and has just about everything you can think of including Raid Drivers; https://www.dell.com/support/kbdoc/en-us/000107478/dell-command-deploy-winpe-driver-packs
Open the CAB file with 7zip or any other zip software and extract the x64 folder to the C:\WinPE\Drivers folder
Scripts
All of the following scripts I use to this day and often. Just add in your own customizations and you'll have a selection menu with the options needed at your finder tips. At this point I don't have any clients with anything lower then Windows 10, so although I still have the MBR and Windows 7/8 scripts, I do not use them. Other items to note; Imaging location is always Z Drive, Windows 10 and 11 I only use UEFI with GPT.
Download the files below
There is a large amount of files created, I'll list the main files that you might want to alter.
Startnet.cmd - WinPE has this file set to autorun on startup.
USB.bat - Primary script that loads after Startnet
WinPE_Server.bat - Customize this file to have multiple preset file share locations
Time to put everything together and create WinPE
Microsoft AIK should be downloaded and installed by this point, including the WinPE drivers, and the scripts. It's time to put it all together and make WinPE media. Open the Deployment and Imaging Tools CMD prompt and copy/paste the following lines into it;
cd "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\"
copype amd64 C:\WinPE\WinPE_amd64
Dism /Mount-Image /ImageFile:"C:\WinPE\WinPE_amd64\media\sources\boot.wim" /index:1 /MountDir:"C:\WinPE\mount"
Dism /Add-Driver /Image:"C:\WinPE\mount" /Driver:"C:\WinPE\Drivers\x64" /recurse
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-HTA.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-HTA_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-RNDIS.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-RNDIS_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-WMI_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-scripting.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-scripting_en-us.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\Winpe-wds-tools.cab"
Dism /Add-Package /Image:"C:\WinPE\mount" /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us\WinPE-wds-tools_en-us.cab"
copy /y C:\WinPE\Scripts\*.* C:\WinPE\mount\Windows\System32\
copy "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\imagex.exe" C:\WinPE\mount\Windows\System32\*
Dism /Unmount-Image /MountDir:"C:\WinPE\mount" /commit
MakeWinPEMedia /ISO C:\WinPE\WinPE_amd64\media C:\WinPE\WinPE.iso
You have now created WinPE ISO! which is located in the C:\WinPE folder. If you would like to create a bootable USB Drive as well, use the following command:
MakeWinPEMedia /UFD C:\WinPE\WinPE_amd64\media <USB Drive Location>:
example; MakeWinPEMedia /UFD C:\WinPE\WinPE_amd64\media E:
You have now created a Custom WinPE ISO/USB Drive
Comments