Deploy Lenovo ThinkCentre, ThinkPad, and ThinkStation BIOS by Custom WinPE
In this blog post, we are updating a previous post that only covered ThinkPad. We have included updated scripting and information to cover ThinkCentre and ThinkStation as well.
Upgrading BIOS versions and getting consistency in an environment can provide unique challenges across an organization. This blog post will lay out a possible process for putting together a custom WinPE boot WIM file to deploy a BIOS upgrades to current ThinkCentre, ThinkPad, and ThinkStation products.
Overview of the solution:
- Setup the server side folder structure
- BIOS Folders
- BIOS update files
- Powershell script
- Add necessary optional components
- Add necessary drivers to the boot image
- Edit the StartNet.cmd file in the WinPE.wim file.
Setup the server side folder structureBeginning with the server side folder structure, create a new share (or use an existing share with appropriate permissions) on a server. In that share, create a folder called BIOSVersions. Inside BIOSVersions, create a folder called Logs and then create a folder with the first 4 digits of the SMBIOSBIOSVersion of each model computer with a BIOS to upgrade.
The folders seen above are for the X1 Carbon 4th (N1FE) and X1 Carbon 3rd (N14E). The contents of each folder are made up of the source files from the Windows installable version of the BIOS from https:\\support.lenovo.com. Once each BIOS has been downloaded and extracted, copy it to the coordinating folder. Be sure to include all files and sub-folders from the extracted location.
Once the folder structure has been created and populated, create a blank Powershell file called BIOSUpdater.ps1 and copy the following lines of code to the file and save it.
Configure the WinPE.wim fileThe next item is to configure the WinPE.wim file with all of the pertinent optional components, drivers, and script updates.
In this example, we have the Windows 10 ADK installed to the default directory (C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment).
Copy the winpe.wim file from amd64\en-us folder to a spot to work with it. I am using D:\TestBIOS\WinPE.wim as the area that is copied to.
Load the the wim file into command window using the DISM Command to open the image.
Next we need to configure Optional Components. Add the following Optional Components in this specific order, as order does matter for this installation:
4. .NET Framework (NetFX):
After loading those optional components, we need to add in a driver for interrogating the battery status on ThinkPads.
Next we load any networking drivers needed. I suggest using the WinPE Boot Image Driver Packs.
The last item is to edit the StartNet.cmd file located at D:\MountIt\Windows\System32. Add the following lines of code to the .cmd file after the "wpeinit" line. Change <Server>, <Share>, <password>, and <domain>\<user> to your appropriate values. Save and then close the file.
Finally we use Dism to close up the WinPE.wim file.
Once the WinPE.wim file closes up completely, load it into WDS or your favorite PXE Service and update a BIOS.
When your ThinkCentre, ThinkPad, or ThinkStation client PXE boots this boot image, it will automatically launch the BiosUpdate.ps1 script. The script will find the appropriate BIOS update source files on the network share and will execute the BIOS update silently. The script will then reboot the system at which time the BIOS will be updated. Once complete the system will reboot back to Windows.