2021-04-27 update: The solution now works over CMG. Please see this post for details.
If you haven’t seen my first blog post about modern driver management, the quick summary is that the solution uses packages created with the Driver Automation Tool and the administration service to retrieve information on these packages and identify the most suitable driver package to apply in a task sequence.
In this second part, I’ll be discussing the changes and improvements done to the existing solution to also dynamically retrieve and filter and apply BIOS updates.
Note: Download link for the task sequence exports is located at the end of the blog post.
Invoke-GetPackageIDFromAdminService improvements
When I initially wrote the script that queries the AdminService, I wanted to make sure I could reuse the same script to return both BIOS and Driver packages. But when it was time to actually design the task sequence for applying BIOS packages, I found out that I forgot something to determine the system’s current BIOS version and filter out any BIOS packages which were not an upgrade to the current system.
New parameters for BIOS information
I needed to provide more information to the script as a parameter regarding the system BIOS. The 2 following parameters were added to the script:
- CurrentBIOSVersion
- CurrentBIOSReleaseDate
Why do you need the release date of the BIOS?
Good question! The original solution by the Nickolaj Andersen and Maurice Daly of MSEndPointMgr uses the BIOS release date for Lenovo systems to determine if the BIOS package is an update or not. Now why exactly? I’m guessing Lenovo was not very good at keeping some sort of standard naming or versioning for their BIOS versions.
BIOS filtering
Now that we have the current BIOS version and release date, we need to evaluate and filter out older BIOS package versions. We only want the script to return a package ID if the package is actually an upgrade for the device.
For this part, I had to dig into the Invoke-CMDownloadBIOSPackage.ps1 script and in the script of the Driver Automation Tool to see how they were filtering and extracting version information for the different vendors. I ended up with the following code to compare BIOS versions.
|
|
With these enhancements done on the script, we are now ready to use a task sequence to dynamically apply BIOS packages.
Task Sequences modifications
Modify the “Query AdminService for PackageID” TS
We need to provide the current BIOS version and release date to the script in the task sequence.
New TS variables used for BIOS packagesThen we pass this information as a parameter to the Invoke-GetPackageIDFromAdminService script.
Create the “Apply BIOS package” task sequence
The task sequence is similar to the one I had created for drivers. For applying the actual BIOS update, I’ve reused the scripts by the guys at MSEndpointMgr.
Regarding HP BIOS updates
If your HP devices have a BIOS password set (I hope you do), then you’ll need to specify 2 more variables:
- PasswordBinFilename: Name of the .bin file to use when applying BIOS update
- PasswordBinPackageID: PackageID of the package containing the .bin file.
I had to modify the original Invoke-HPBIOSUpdate script to add a new parameter to specify the path to the .bin file because the original script would expect the .bin file to be in the same folder as the script.
I also did not like the fact that the HP BIOS utility writes a log file in whatever directory it’s located in with no options to specify a different log path, so I added a step to move the log file to _SMSTSLogPath.
Download
Direct link to the task sequences
As always, feel free to contact me if you have any suggestions for improvements.
Thank you.
Charles Tousignant Contributor
Charles, a.k.a. 'No Remote Users' from MMS 2019, is a senior analyst working in the public sector focusing on Windows and systems management.