Managing Lenovo BIOS Settings (Part 3)

by Sep 5, 2018

In the previous tip we explained how to manage Lenovo BIOS settings from PowerShell. Typically, there are single settings that need to be managed. Please note that you need Administrator privileges for some of the operations.

Here is code that dumps the names of all available settings. Note that these names are case-sensitive:

$currentSetting = Get-WmiObject -Class Lenovo_BiosSetting -Namespace root\wmi 
$currentSetting.CurrentSetting | 
    Where-Object { $_ } |
    ForEach-Object { $_.Split(',')[0] }

Once you know the name of a setting you’d like to control, this is the code you can use to read the setting:

$Settingname = "WakeOnLAN"

$currentSetting = Get-WmiObject -Class Lenovo_BiosSetting -Namespace root\wmi -Filter "CurrentSetting LIKE '%$SettingName%'"

This is the code that dumps the available values for a given setting:

#requires -RunAsAdministrator

# this is case-sensitive
$Setting = "WakeOnLAN"

$selections = Get-WmiObject -Class Lenovo_GetBiosSelections -Namespace root\wmi

And this is how you can change a setting to a new value (i.e., disabling WakeOnLan):

#requires -RunAsAdministrator

$currentSetting = Get-WmiObject -Class Lenovo_SetBiosSetting -Namespace root\wmi

$SaveSettings = Get-WmiObject -Class Lenovo_SaveBiosSettings -Namespace root\wmi

Twitter This Tip! ReTweet this Tip!