-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Notebooks
- Notebook Operating System and Recovery
- Change BIOS settings - WMI - Powershell - Password protected

Create an account on the HP Community to personalize your profile and ask a question
01-19-2018 02:39 AM
Hello,
we are currently trying to automate many things regarding BIOS settings by using powershell and the HP instrumentedbios WMI namespace.
Changing settings through a simple powershell command like this is kinda easy and works fine:
$BIOS = gwmi -class hp_biossettinginterface -Namespace "root\hp\instrumentedbios"
$result = $BIOS.SetBIOSSetting("NumLock on at boot", "Enable")
The issue we are running into is a password protected BIOS. Doing the same thing as above with a password parameter simply isn't working. I've already found this post (https://h30434.www3.hp.com/t5/Notebook-Operating-System-and-Recovery/Powershell-Command-to-Make-Chan...) but unfortunately it doesn't help. Using this method to encode our password and adding it as the password paremeter still results in returncode 6(="Access Denied"). It's a simple password containing lower case letters and numbers, no special signs and such.
$BIOS_PW = "<kbd/>" + (Convert-ToKbdString -UTF16String "OurPassword")
$BIOS = gwmi -class hp_biossettinginterface -Namespace "root\hp\instrumentedbios"
$result = $BIOS.SetBIOSSetting("NumLock on at boot", "Enable", "$BIOS_PW")
We are running into this issue on all our current devices (820/840 G3, Zbook 17, Zbook 15).
How am I supposed to encode/encrypt my password and add it as parameter to the SetBIOSSetting function?
Current BIOS version: N75 Ver 01.22 12/12/2017
Solved! Go to Solution.
Accepted Solutions
01-19-2018 04:17 AM
Well, nevermind. This way it is working:
$Password = "<utf-16/>"+"mypassword"
$BIOS = gwmi -class hp_biossettinginterface -Namespace "root\hp\instrumentedbios"
$result = $BIOS.SetBIOSSetting("NumLock on at boot", "Enable", "$Password")
This results in return 0(="Success")
01-19-2018 04:17 AM
Well, nevermind. This way it is working:
$Password = "<utf-16/>"+"mypassword"
$BIOS = gwmi -class hp_biossettinginterface -Namespace "root\hp\instrumentedbios"
$result = $BIOS.SetBIOSSetting("NumLock on at boot", "Enable", "$Password")
This results in return 0(="Success")