• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
Are you having HotKey issues? Click here for tips and tricks.
Check out our WINDOWS 11 Support Center info about: OPTIMIZATION, KNOWN ISSUES, FAQs, VIDEOS AND MORE.
HP Recommended

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

1 ACCEPTED SOLUTION

Accepted Solutions
HP Recommended

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

View solution in original post

1 REPLY 1
HP Recommended

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

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.