This project contains PowerShell scripts for viewing and modifying BIOS/Firmware settings on Dell, HP, and Lenovo systems. For more information about the scripts, refer to my blog.
https://www.configjon.com/category/dell/
Firmware and BIOS management scripts.
License: MIT License
This project contains PowerShell scripts for viewing and modifying BIOS/Firmware settings on Dell, HP, and Lenovo systems. For more information about the scripts, refer to my blog.
https://www.configjon.com/category/dell/
Whenever I tried to use -SetupSet from Powershell directly, I would get the error ""When using the OldSetupPassword or SetupPassword parameters, one of the SetupChange or SetupClear parameters must also be specified"
As far as I can tell the error stems from lines 315-320
if (($OldSetupPassword -or $SetupPassword) -and !($SetupChange -or $SetupClear)) { $ErrorMsg = "When using the OldSetupPassword or SetupPassword parameters, one of the SetupChange or SetupClear parameters must also be specified" Write-LogEntry -Value $ErrorMsg -Severity 3 throw $ErrorMsg }
SetupSet requires the -SetupPassword parameter but then this code throws an error because neither $SetupChange or $SetupClear are true
When trying to run the PS scripts for both Lenovo and HP, I get the following error:
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quot
ation marks ("&") to pass it as part of a string.
Not all parse errors were reported. Correct the reported errors and try again.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : AmpersandNotAllowed
What am I doing wrong?
Cannot find a way to combine the HP, Dell and Lenovo script into one and add a filter to only execute which BIOS script depending on the specific manufacturer.
When there is a supervisor password set I am unable to change the settings in the BIOS. I used the "-SupervisorPassword Password" but In the log it says no passwords are currently set so I believe it's just not identifying there is one. Without a supervisor password it all works great. I'm currently trying to use this for a school district to config the BIOS on over 1900 laptops this summer. I plan to crawl through the script and try to get it working but any help or feedback would be greatly appreciated. Thanks!
Inside script Manage-LenovoBiosPasswords.ps1, some Write-LogEntry calls do not have "-Severity" parameter set.
There must be either a default parameter being set or those parameter being added to the missing lines.
As you known, Cfg lock is important in hackintosh, but it is hidden by Lenovo in its BIOS UI interface.
Is there any way to read and set the hidden items in Lenovo BIOS?
First up, thanks for the script, it's been really useful. However, today got an error. It is likely mostly cosmetic, but it'd be nice to fix in any case...
PS C:\Users\pwoodward\gitrepos\Intune> .\Scripts\install-hpcmsl.ps1
Log path set to C:\ProgramData\WWF-UK\logs\Install-HPCMSL.log
Failed to import the HPCMSL module
At C:\Users\pwoodward\gitrepos\Intune\Scripts\install-hpcmsl.ps1:100 char:5
+ throw $ErrorMessage
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Failed to import the HPCMSL module:String) [], RuntimeException
+ FullyQualifiedErrorId : Failed to import the HPCMSL module
PS C:\Users\pwoodward\gitrepos\Intune
![ss](https://user-images.githubusercontent.com/6294052/154096516-be14aa28-2b3c-4bd8-a7f2-c833169e0a83.png)
>
**Failed to import the HPCMSL module**
**Exception Message: Cannot add type. The type name 'SureAdminSetting' already exists.**
When running Manage-DellBiosPasswords-WMI.ps1 from within Windows 11 OS the follow error occurs.
Join-Path : Cannot bind argument to parameter 'Path' becuase it is an empty string.
Line 388
This refers to setting the log file path: $LogFilePath = Join-Path -Path $LogsDirectory -ChildPath $FileName
After some testing it seems that the script is falsely detecting that its running in a Task Sequence within the Get-TaskSequenceStatus Function. It is finding the Task Sequence Object but the $TSEnv.Value("_SMSTSType") is empty. The script is check if its NULL which it is not. I fixed this (I think) by added another check for if('' -eq $SMSTSType).
Why I have a blank _SMSTSType on the computer OS, I am not sure.
If this works like the Lenovo Bios Config Tool you cant set a password if no password is set correct? You can only change an existing password.
These scripts are really helpful in an IT environment. Did you also look into similar WMI classes etc for Acer and Asus PCs?
$Settings = (
"SecureBoot,Disable"
)
and
$Settings = (
"Secure Boot,Disable"
)
both throw errors saying the setting was not found.
<![LOG[The specified setup password matches the currently set password]LOG]!><time="12:52:03.363-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="1" thread="2332" file="">
<![LOG[Setting "SecureBoot" not found]LOG]!><time="12:52:03.395-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="2" thread="2332" file="">
<![LOG[0 settings already set correctly]LOG]!><time="12:52:03.410-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="1" thread="2332" file="">
<![LOG[0 settings successfully set]LOG]!><time="12:52:03.410-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="1" thread="2332" file="">
<![LOG[0 settings failed to set]LOG]!><time="12:52:03.410-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="3" thread="2332" file="">
<![LOG[1 settings not found]LOG]!><time="12:52:03.410-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="2" thread="2332" file="">
<![LOG[END - HP BIOS settings management script]LOG]!><time="12:52:03.426-300" date="07-02-2024" component="Manage-HPBiosSettings" context="NT AUTHORITY\SYSTEM" type="1" thread="2332" file="">
Status returned is "0" indicating success, yet when rebooting the setting is still the old value and doesn't save.
First of, thanks for all the time you put into these scripts :)
On your website, https://www.configjon.com/lenovo-bios-password-management/, you describe some problems with clearing the Power On password.
From the Lenovo Documentation regarding removing af Power On password:
To remove the power-on password when a supervisor password is set, it must be done in three steps total:
a. Change the supervisor password. It’s OK to specify the same password as both the current and the
new, in case you don’t really want to change it. But you must do this step.
b. Change the power-on password by specifying the current password and a NULL string as the new
password
c. Reboot the system (do not reboot between steps A and B).
Looking at the Clear-LenovoBiosPassword function it doesn't seem like you are doing the Superviser part (A)? Perhaps that would fix "the Power On Password Issue" described on the webpage?
I haven't been able to find it elsewhere in the script (Perhaps I'm semi blind, and then sorry for troubling you).
BIOS-Settings wont save if you have a BIOS-password set.
To make sure the settings are saved you need to edit
$SaveSettings.SaveBiosSettings() | Out-Null
To
($SaveSettings.SaveBiosSettings("$SupervisorPassword,ascii,us”)) | Out-Null
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.