Powershell script to change Lenovo Bios settings RRS feed

  • Question

  • Hi,

    Need help in seeting the below command right. I am trying to set "Virtualization tecnhnology" bios setting on a remote computer but getting error.

     (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting -ComputerName xxxx ("VT-d,Enable")

    1) Please help in setting this command right

    2) Need the command to save the setting

    3) Any powershell to change the same setting on a dell computer


    Tuesday, April 28, 2015 3:19 AM


All replies

  • Each vendor supplies custom WMI support.  YOu need to post in thevendor forum for support for the specific system.

    You can also use your search engine too find examples:


    • Proposed as answer by jrv Tuesday, April 28, 2015 8:35 AM
    • Marked as answer by Boe ProxMVP, Moderator Sunday, July 26, 2015 3:34 AM
    Tuesday, April 28, 2015 8:35 AM
  • Here is an actual answer, not just a waste of time "you should Google" response.

    #To see all current bios settings
    gwmi -class Lenovo_BiosSetting -namespace root\wmi | ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}}
    #You can enumerate this list then use notepad++ to put all of the current settings into a powershell command like below

    #To set a bios setting:
    (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("WakeOnLAN,Disable")

    #To save all changes!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings()

    #To set a bios setting with supervisor password:
    (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("WakeOnLAN,Disable,password,ascii,us")

    #To save all changes with a supervisor password!!!!!!!!!!!!!!!!
    (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings("password,ascii,us”)

    #Here are the settings I used to configure the Lenovo M79, inlcuding boot order.
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Serial Port1 Address,3F8/IRQ4")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Support,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Legacy Support,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Front USB Ports,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 1,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 2,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Rear USB Ports,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 3,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 4,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 5,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("USB Port 6,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("SATA Controller,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("SATA Drive 1,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("SATA Drive 2,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("SATA Drive 3,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Configure SATA as,AHCI")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Native Mode Operation,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Hard Disk Pre-delay,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("UMA Frame Buffer size,Auto")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Primary Video Controller,Auto")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Surround View,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Onboard Audio Controller,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Onboard Ethernet Controller,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Boot Agent,PXE")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("C6,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("DASH Support,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("After Power Loss,Last State")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Enhanced Power Saving Mode,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("ICE Performance Mode,Better Acoustic Performance")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("ICE Thermal Alert,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Wake on LAN,Automatic")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Wake from PCI Modem,Primary")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Wake from Serial Port Ring,Primary")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Wake from PCI Device,Primary")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Allow Flashing BIOS to a Previous Version,Yes")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Require Admin. Pass. when Flashing,No")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Require POP on Restart,No")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("POP Changeable by User,Yes")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Require Admin. Pass. for F12 Boot,No")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Smart USB Protection,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("TCG Security Feature,Inactive")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Physical Presence for Provisioning,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Physical Presence for Clear,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Preboot Authentication,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Require HDP on Restart,No")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Secure Boot,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Chassis Intrusion Detection,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Configuration Change Detection,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("CSM,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Boot Mode,Auto")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Boot Priority,Legacy First")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Quick Boot,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Boot Up Num-Lock Status,On")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Keyboardless Operation,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Option Keys Display,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Option Keys Display Style,Normal")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Startup Device Menu Prompt,Enabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("OS Optimized Defaults,Disabled")
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("Primary Boot Sequence,Hard Drive:Network Card:USB Floppy:USB Key:USB Hard Disk:USB CD/DVD")

    • Proposed as answer by Cory Ulrich Tuesday, June 20, 2017 1:01 PM
    • Edited by Cory Ulrich Tuesday, June 20, 2017 1:03 PM
    Tuesday, June 20, 2017 1:01 PM
  • Sorry but we don't provide support for Lenovo in this forum.  Please post your issues to a Lenovo forum.


    Tuesday, June 20, 2017 1:30 PM
  • Is there anyway you could help me figure out this dilemma. I am new to coding but trying to figure out why this will not run to multiple computers using this script 

    $Settings = 'Primary Boot Sequence,Hard Drive:Network Card:USB Key;[Exclude from boot order:USB Hard Disk:USB CD/DVD:Floppy Drive: USB Floppy:CD/DVD Drive]'

    $pcnames = Import-Csv pcnames.csv
    foreach ($name in $pcnames) {Set-LenovoBIOSSettings -ComputerName $name.ColumnName -SettingsToBeApplied $Settings}

    Tuesday, January 9, 2018 2:38 PM
  • I am able to get the code to run like this. However I am now getting a invalid parameter for the return 

    $pcnames = Import-Csv pcnames.csv
    foreach ($name in $pcnames){ 
    (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting('Primary Boot Sequence,Hard Drive:Network Card:USB Key;[Exclude from boot order:USB Hard Disk:USB CD/DVD:Floppy Drive: USB Floppy:CD/DVD Drive]')

    Tuesday, January 9, 2018 3:34 PM
  • Please read the answer in this thread and follow the instructions.  Post Lenovo issues in the Lenovo forum.  We cannot help you with this.


    Tuesday, January 9, 2018 3:46 PM
  • try with SCCM if you are within an enterprise using BIOS configuration tool provided by Lenovo like HP BIOS config tool,

    it will help define and monitor BIOS configuration as any OS configuration through SCCM technology

    Cherif Benammar

    Sunday, May 20, 2018 4:06 PM
  • try with SCCM if you are within an enterprise using BIOS configuration tool provided by Lenovo like HP BIOS config tool,

    it will help define and monitor BIOS configuration as any OS configuration through SCCM technology

    Cherif Benammar

    The SCCM BIOS tools did not exist in 2015. Try not trying to answer old threads that are answered and closed. 

    Here is the SCCM BIOS tool and instructions.  It was released late 20177.


    • Edited by jrv Sunday, May 20, 2018 4:11 PM
    Sunday, May 20, 2018 4:11 PM