-
×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
- Desktops
- Desktop Software and How To Questions
- Set BIOS Password Using SetBiosSetting() Method

Create an account on the HP Community to personalize your profile and ask a question
12-01-2016 06:27 AM
Hello,
I am attempting to set a BIOS password on my machines using the HPBIOSSettingInterface WMI Object. My question is do newer models of HP PCs support using the SetBIOSSetting() method to set a BIOS password on a workstation?
When I attempt to use the method, it keeps returning code "5", meaning "invalid parameter"
Here is the code I am attempting to run in PowerShell
$BIOS = Get-WMIObject HP_BIOSSettingInterface -Namespace "root\HP\InstrumentedBIOS"
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','')
Is the above able to be used by all HP workstations?
Thank you,
Daniel
Solved! Go to Solution.
Accepted Solutions
12-01-2016 07:44 AM
Nevermind - I found the problem:
I needed to include the encoding even though there isn't a password established.
So, instead of using this:
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','')
I used this and it worked:
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','<utf-16/>')
Hope this helps someone out in the future.
Thanks,
Daniel
12-01-2016 07:44 AM
Nevermind - I found the problem:
I needed to include the encoding even though there isn't a password established.
So, instead of using this:
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','')
I used this and it worked:
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>TheBIOSPassword','<utf-16/>')
Hope this helps someone out in the future.
Thanks,
Daniel