cancel
Showing results for 
Search instead for 
Did you mean: 
AKazanovskiy
New member
3 1 0 0
Message 1 of 4
3,623
Flag Post

change bios password by powershell

HP Recommended
hp z220
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 :
# 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
 
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
Return : 0
PSComputerName :
# it works
3 REPLIES 3
Lil_Boy_Blue
Level 12
7,692 7,654 333 708
Message 2 of 4
Flag Post
HP Recommended

Hi

Can you give a powershell command that would return the current password?

 

http://support.moonpoint.com/os/windows/PowerShell/win32_bios.php

 

 

Was this reply helpful? Yes No
AKazanovskiy
Author
New member
3 1 0 0
Message 3 of 4
Flag Post
HP Recommended

I haven't this commands in powershell. But I need it.

Was this reply helpful? Yes No
Lil_Boy_Blue
Level 12
7,692 7,654 333 708
Message 4 of 4
Flag Post
HP Recommended

Hi

 

This is a dangerous subject area and I have sent a link via Private Message to avoid anyone else bricking a machine through trying to change/reset a password and making a typo.

Was this reply helpful? Yes No
Warning 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