Loading...

Check if a Lenovo device has the latest BIOS version with only PowerShell

Reply A+ A-


In this post I will show you how to get the latest BIOS version available for a specific model with PowerShell and only PowerShell.


Context

- You have some Lenovo devices

- You don't use Lenovo Vantage

- You want to see if your BIOS is uptodate


The solution

Last week I saw a tweet mentioning a cool Lenovo module called Lenovo Device Management Module (LDMM).

See here or here more info about it.

This module allows you to manage Lenovo features.

First thing I did was to check the BIOS side.


See below how to install the module:

1. Download the module here

2. Extract content

3. Import the module


Note that the module is not available on the PowerShell gallery, hoping soon.


Check latest BIOS with module

Now let's check the latest BIOS version for a specific model with the module.

1. Open PowerShell

2. Import the module

3. The cmdlet to use is: Get-LnvAvailableBiosVersion

4. Specify the MTM in parameter MachineType 

5. To get the MTM for a model just type the below command:

5. Then type the below cmdlet:

6. It will give the latest BIOS version for the specified model MTM

7. To download the BIOS version just add parameter Download as below:

8. You can also get ReadMe info by adding parameter Readme:

9. See below the result:


Check latest BIOS without module

In my case I'm not a fan of importing module in my scripts/tool.

I explored a bit the module and find that the process is pretty easy.

Actually to get information about BIOS and drivers, the URL to use is:

https://download.lenovo.com/catalog/<MTMModel>_<Win10orWin11>.xml


For instance if you have a T14s Gen4 on Windows 10 (MTM 21F7), the URL should be:

https://download.lenovo.com/catalog/21F7_Win10.xml 


See below the result in a browser:

If you search for BIOS you get this:

It gives you a URL and this URL gives you BIOS info:


See below the code to: 

- Get current MTM model 

- Get current Windows version

- Get current BIOS version

- Check latest BIOS for this MTM

- Check latest BIOS release date

- Compare current version and latest


See the code:


What's next ?

In the next post I will show you:

- A remediation script to check for all devices if BIOS is uptodate or not

- An Azure Automation script to export devices bios status to a CSV on SharePoint with a tams notif

- A Logic App to export devices bios status to a CSV on SharePoint with a tams notif

slider 5428436900887505545

Enregistrer un commentaire

Accueil item

Award

Learn KQL in one month

Sponsors

You want to support me ?

Mes articles en français

Books in French


Stats