cancel
Showing results for 
Search instead for 
Did you mean: 
Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.

Manage Lenovo BIOS settings remotely

shawnsong
Rising Star III
Rising Star III

Hey folks,

Recently @BrightRodger asked is it possible to manage BIOS via JC command - I think it's a pretty cool idea. After a quick research it turns out the BIOS for the big 3 (Lenovo, HP, Dell) all have PowerShell manageability!

Inspired from the articles:

Lenovo BIOS Settings Management

HP BIOS Settings Management

Working with the Dell Command | PowerShell Provider

I had a chance to test in JC cmd on my Lenovo box, let's dive into it. 

As usual, create a new JumpCloud command -> Select Windows and PowerShell. Now pick a setting and put it in the first line - I'm using "WakeOnLANDock" as an example:

 

<#
Disclaimer: Modifying the BIOS settings can be a complex and potentially dangerous process. Improper changes to the BIOS settings can cause serious harm to your computer, including system instability, hardware damage, and loss of data. If you are not familiar with the process or not confident in your ability to make the necessary changes, it is recommended that you seek the assistance of a qualified professional. By proceeding with changes to the BIOS settings, you assume full responsibility for any consequences that may result, and relieve the publisher and authors of this information of any liability. 
#>

# Pick a setting to set
 $settingName = "WakeOnLANDock"

 # Getting the current setting
 $currentSettings = Get-WmiObject -Namespace root\wmi -Class Lenovo_BiosSetting | Select-Object CurrentSetting
 $currentValue = ($currentSettings | Where-Object {$_.CurrentSetting -Like "*$settingName*"}).CurrentSetting.replace(',','=')
 $settingValues = (gwmi –class Lenovo_GetBiosSelections –namespace root\wmi).GetBiosSelections($settingname).selections
 Write-Host "Settings available for $settingname : $settingvalues"
 Write-Host "The current setting is $currentValue"
 
 # Setting the new value
 $newValue =  $settingvalues.Split(',')[1] # Pick and choose a value, in this case is "disable"
 Write-Host "$settingname is going to be set as $newvalue.."
 
 $setSettings = Get-WmiObject -Namespace root\wmi -Class Lenovo_SetBiosSetting
 $setSettings.SetBiosSetting("$settingName,$newValue")
 
# Connect to the Lenovo_SetBiosSetting WMI class
 Write-Host "Saving the bios setting..."
 $SaveSettings = Get-WmiObject -Namespace root\wmi -Class Lenovo_SaveBiosSettings
 $SaveSettings.SaveBiosSettings()
 

 

Save it and give it a run!

You can find the full list of the settings here from Lenovo. A few interesting settings:

 

BootMode
BootOrderLock 
FingerprintSecurityMode 
SecureBoot 

 

P.S. I don't have Dell & HP boxes to test but they work similarly - especially HP, it uses the almost identical WMI classes. They should be able to work well with JC cmd like Lenovo. 

 

0 REPLIES 0
You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.