Changing Lenovo Bios Settings with PS

This topic contains 5 replies, has 3 voices, and was last updated by  Marc 1 week, 5 days ago.

  • Author
    Posts
  • #85177

    Marc
    Participant

    Hello everyone

    A little story before I ask for help.

    —Story–
    I work in a community college. I've been in the IT industry for over 15 years. In these 15+ years I had it in my head that I hate programming because of my experience with it in College. Recently, I accidentally installed 8GB sticks in 4 of 35 computers in a lab. I noticed this only after all the RAM was installed. I was angry at the fact that I would have to crack open all the computers to visually check every one of them. I rant to my colleague about it. He says give me 5 minutes. Sure enough 5 minutes later he tells me, it's in the following 4 computers. MAGIC!

    Thus begins my , marvelous? journey into the world of programming. I decided to start with Powershell, wish me luck 🙂

    –end story–

    As previously mentioned, I am a technologist working in a community college. We recently purchased a whole bunch of Lenovo ThinkCentre M710s. In the BIOS there is an option to have the computer power on or off at certain times. I don't feel like logging into each computer to change this and was hoping that I can use Powershell to enable these settings. We were previously purchasing Dell PCs and they had a program that with the help of SCCM we were able to automate changing the BIOS settings. I cannot find any software like this for our Lenovo machines. Therefore I figured I would try and make my own.

    So far to prepare myself I watched Getting Started with Microsoft PowerShell with Jason Helmick and Jeffrey Snover. After finishing that I even felt adventurous enough to watch Advanced Tools & Scripting with PowerShell 3.0 , again with the same duo.

    So now I am here to take advantage of this helpful PS community. I have a few questions for everyone.

    *EDIT*
    I found this Lenovo BIOS Windows Management Instrumentation Interface Deployment Guide for Desktop

    I am currently reading this guide. I erased my original questions and I will post any future questions as a reply if I get stuck. In the meantime I am open to any suggestions on how to best handle this problem.

    Thank you all in advance. I look forward to learn with you guys by my side 🙂

  • #85178

    Richard Siddaway
    Moderator

    Some Lenovo machines appear have a CIM classes in the root\wmi namespace

    You can view them with
    Get-CimClass -Namespace root/WMI -ClassName l*

    First thing is to check they are present. I found
    Lenovo_BIOSElement
    Lenovo_SetBiosSetting
    Lenovo_DiscardBiosSettings
    Lenovo_BiosSetting
    Lenovo_SaveBiosSettings
    Lenovo_SetBiosPassword
    Lenovo_BiosPasswordSettings
    Lenovo_LoadDefaultSettings

    If they are present
    Get-CimInstance -Namespace root/WMI -ClassName Lenovo_BiosSetting

    will show you the actual bios settings. You need to use Lenovo_SetBiosSetting to make the changes

    For learning more about PowerShell and WMI I recommend PowerShell and WMI https://www.manning.com/books/powershell-and-wmi I t has a lot of examples on performing admin actions with WMI as well as explaining how WMI works.

    My day's not been too bad apart from the fact its been raining so I couldn't get out to complete my 1200 miles in 2017 challenge

    • #85181

      Marc
      Participant

      Thank you for your response Richard.

      I wish you guys could see how many tabs I have open in my browser right now. I feel like the scene where Bambi is learning to walk. I am currently reading up on WMIs. I've heard about them and have a very very.... VERY limited understanding on them right now 😛 I found this nice little blog about WMIs. I thought I would share for anyone else that might browse this thread and benefit from my findings.

      I appreciate your explanations! I am here to learn and not have you guys just write the script for me. I'm going to look at your response a bit longer, read some more on WMIs and I will give you an update if I get stuck. As of right now I've been provided with enough guidance to hopefully resolve this issue.

      Again, thank you for your time!

  • #85220

    js
    Participant

    My lenovo bios .bat script looks like this:

    cfgwin /r /path:mysettings.txt /admin:mypass,ascii,us
    
    • #85346

      Marc
      Participant

      JS

      Could you explain your script to me? What I am guessing is that you went into the BIOS of a Lenovo machine. Setup everything the way you wanted. Ran the lenovo_biossetting and out-filed it to a .txt You then apply that .txt which are all the settings you want to a list of other computers?

      Here's where I am at.

      I read up on WMI and CIM repositories until my head hurt. I now managed to query a remote system and output the result into a txt file so that I could read the current settings. I then logged onto that computer, changed the settings manually to what I would want and ran my script again and saved it to a different .txt so that I could compare the two.

      So here's the result I got.
      Unconfigured bios
      Active : True
      CurrentSetting : Alarm Time(HH:MM:SS),[00:00:00][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_73
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Alarm Date(MM/DD/YYYY),[01/01/2016][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_74
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Alarm Day of Week,Sunday;[Optional:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_75
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Sunday,Disabled;[Optional:Disabled,Enabled][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_76
      PSComputerName : 4135-01

      Here's the configured BIOS (I setup the computer to use a wake up alarm at 3am on Sundays on a weekly basis)

      Active : True
      CurrentSetting : Alarm Time(HH:MM:SS),[00:00:00][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_73
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Alarm Date(MM/DD/YYYY),[01/01/2016][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_74
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Alarm Day of Week,Sunday;[Optional:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_75
      PSComputerName : 4135-01

      Active : True
      CurrentSetting : Sunday,Disabled;[Optional:Disabled,Enabled][Status:ShowOnly]
      InstanceName : ACPI\PNP0C14\1_76
      PSComputerName : 4135-01

      I am reading the Lenovo Guide and I know I have to use Lenovo_SetBiosSetting to set it but I can't figure out the syntax. I piped Lenovo_SetBiosSetting to GM and got some results. It listed Methods and Properties. However, I can't figure out how to say "set the following settings"

      I'm closer than I was before though and feeling encouraged.

      Thanks for the help guys.

  • #85265

    Marc
    Participant

    *edit* figured out my connection issue

You must be logged in to reply to this topic.