-
×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
- Business PCs, Workstations and Point of Sale Systems
- change bios password by powershell

Create an account on the HP Community to personalize your profile and ask a question
Your account also allows you to connect with HP support faster, access a personal dashboard to manage all of your devices in one place, view warranty information, case status and more.
It has been a while since anyone has replied. Simply ask a new question if you would like to start the discussion again.
11-05-2018 12:01 AM
Product: hp z220
Operating System: Microsoft Windows 10 (64-bit)
$comp = 'in4412250'
$BIOS = Get-WMIObject HP_BIOSSettingInterface -Namespace "root\HP\InstrumentedBIOS" -cn $comp
# 111111 - old password
# bjc[g - new password
$BIOS.SetBIOSSetting('Setup Password','<utf-16/>,bjc[g','<utf-16/>,111111') # work! ?????
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 6
PSComputerName :
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 6
PSComputerName :
# Return : 6 - what does it mean?
# another case
$comp
in4412250
PS C:\data\inv> if (gwmi HP_BIOSPassword -cn $comp -Namespace "root\HP\InstrumentedBIOS" -Filter "Name = 'Setup Password' AND IsSet = 1") {"setup password set on $comp"} else {"setup password not set on $comp"}
setup password not set on in4412250
PS C:\data\inv> $BIOS = Get-WMIObject HP_BIOSSettingInterface -Namespace "root\HP\InstrumentedBIOS" -cn $comp
PS C:\data\inv> $BIOS
__GENUS : 2
__CLASS : HPBIOS_BIOSSettingInterface
__SUPERCLASS : HP_BIOSSettingInterface
__DYNASTY : HP_BIOSSettingInterface
__RELPATH : HPBIOS_BIOSSettingInterface.InstanceName="ACPI\\PNP0C14\\0_0"
__PROPERTY_COUNT : 2
__DERIVATION : {HP_BIOSSettingInterface}
__SERVER : IN4412250
__NAMESPACE : root\HP\InstrumentedBIOS
__PATH : \\IN4412250\root\HP\InstrumentedBIOS:HPBIOS_BIOSSettingInterface.InstanceName="ACPI\\PNP0C14\\0_0"
Active : True
InstanceName : ACPI\PNP0C14\0_0
PSComputerName : IN4412250
PS C:\data\inv> $BIOS.SetBIOSSetting('Setup Password','<utf-16/>,bjc[g','<utf-16/>') # Z220,Z230
in4412250
PS C:\data\inv> if (gwmi HP_BIOSPassword -cn $comp -Namespace "root\HP\InstrumentedBIOS" -Filter "Name = 'Setup Password' AND IsSet = 1") {"setup password set on $comp"} else {"setup password not set on $comp"}
setup password not set on in4412250
PS C:\data\inv> $BIOS = Get-WMIObject HP_BIOSSettingInterface -Namespace "root\HP\InstrumentedBIOS" -cn $comp
PS C:\data\inv> $BIOS
__GENUS : 2
__CLASS : HPBIOS_BIOSSettingInterface
__SUPERCLASS : HP_BIOSSettingInterface
__DYNASTY : HP_BIOSSettingInterface
__RELPATH : HPBIOS_BIOSSettingInterface.InstanceName="ACPI\\PNP0C14\\0_0"
__PROPERTY_COUNT : 2
__DERIVATION : {HP_BIOSSettingInterface}
__SERVER : IN4412250
__NAMESPACE : root\HP\InstrumentedBIOS
__PATH : \\IN4412250\root\HP\InstrumentedBIOS:HPBIOS_BIOSSettingInterface.InstanceName="ACPI\\PNP0C14\\0_0"
Active : True
InstanceName : ACPI\PNP0C14\0_0
PSComputerName : IN4412250
PS C:\data\inv> $BIOS.SetBIOSSetting('Setup Password','<utf-16/>,bjc[g','<utf-16/>') # Z220,Z230
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 0
PSComputerName :
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 0
PSComputerName :
# it works
3 REPLIES 3
11-05-2018 03:44 AM - edited 11-05-2018 03:48 AM
Hi
Can you give a powershell command that would return the current password?
http://support.moonpoint.com/os/windows/PowerShell/win32_bios.php
Be alert for scammers posting fake support phone numbers and/or email addresses on the community.
If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.
Didn't find what you were looking for?
Ask the community
† 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>.