Get HP Bios Password Set

Hi All,

i’m trying to create Relevace to get if BIOS Password is Setted using Wmi Class called HP_BIOSSetting.

I try this Clause:
string values of properties “name” of select objects “name from HP_BIOSSetting where name = ‘Setup Password’” of wmis “root\hp\instrumentedbios”

And it works fine, but if i modify Proprerties “IsSet” it return Query not Valid.

string values of properties "IsSet of select objects “name ,isset from HP_BIOSSetting where name = ‘Setup Password’” of wmis “root\hp\instrumentedbios”

The relevance shoud be ok , where i failed? with powershell i check and the Wmi query is ok.

It’s really difficult to tell without posting your exact query, and using the code formatting tag in the Forum to ensure you don’t have an issue with quoting or spaces

Hello Jason,

here the exact query that im using to HP Product:

string values of properties "name" of select objects "name  from HP_BIOSSetting where name = 'Setup Password'" of wmis "root\hp\instrumentedbios"

This query works and in Fixlet Debugger return “Setup Password”.

now i need to get the properties called IsSet and i modify the query with the following Expression:

string values of properties "IsSet" of select objects "name,Isset  from HP_BIOSSetting where name = 'Setup Password'" of wmis "root\hp\instrumentedbios"

but i receive back the following error: 0x80041017 query WMI not Valid

Great, thanks, that helps.

Can you try this query and post the results? It should list all the properties available…

properties of select objects "* from HP_BIOSSetting" of wmis "root\hp\instrumentedbios"

I think your ‘IsSet’ is not a WMI property, but a method from the PowerShell class that retrieves WMI properties. Checking for the existence/value may require something else in relevance, which is why I’m trying to explore which properties are available.

We set HP BIOS passwords wrapped in a powershell and executed by Bigfix. Here is the core step from our script for your inspiration.

Write-StoreLog -Message ($myBIOSOperationNode.Description + “.”) -Destination Stream -Severity Information
$myBIOSReturnCode = Invoke-CimMethod -InputObject $myBIOSConfiguration -MethodName SetBIOSSetting -Arguments @{Name=$myBIOSOperationNode.Name; Value=(ConvertTo-PlainText -SecureString $myBIOSNewPasswordSecure); Password=(ConvertTo-PlainText -SecureString $myBIOSCurrentPasswordSecure)} -Verbose

1 Like

Here is powershell wrapped WMI query that we use on our HP devices.

(Test-Path -LiteralPath (Expand-StoreVariables -String $myScriptParameterNode.BaselineFlag.File) -PathType Leaf)) -and (Get-CimInstance -ClassName “HP_BIOSPassword” -Filter (“Name = '” + $myBIOSOperationNode.Name + “’ And IsSet = ‘1’”) -Namespace “Root/HP/InstrumentedBIOS”))

1 Like