{"id":256,"date":"2008-09-24T10:17:59","date_gmt":"2008-09-24T10:17:59","guid":{"rendered":"http:\/\/andrius.kozeniauskas.com\/blog\/?p=256"},"modified":"2008-09-24T10:17:59","modified_gmt":"2008-09-24T10:17:59","slug":"hp-remotely-change-bios-password-with-a-script","status":"publish","type":"post","link":"http:\/\/www.kozeniauskas.com\/itblog\/2008\/09\/24\/hp-remotely-change-bios-password-with-a-script\/","title":{"rendered":"HP: Remotely change Bios password with a script"},"content":{"rendered":"<p>Many people were looking how to change the Bios password remotely. <a href=\"http:\/\/andrius.kozeniauskas.com\/blog\/2008\/01\/18\/remotely-change-bios-settings\/\">Please read my previous post about the Bios settings<\/a>. To set Bios\u00a0password you will need Key scan codes the information about them is also given in my <a href=\"http:\/\/andrius.kozeniauskas.com\/blog\/2008\/01\/18\/remotely-change-bios-settings\/\">previous post.<!--more--><br \/>\n<\/a>So this is how you do it:<\/p>\n<p>First we take the script form my <a href=\"http:\/\/andrius.kozeniauskas.com\/blog\/2008\/01\/18\/remotely-change-bios-settings\/\">previous post<\/a> and slightly modify it.<br \/>\n1. The follwing\u00a0script sets the Bios password to &#8216;<em>password<\/em>&#8216; on the machine that had not password set.<\/p>\n<p><em>Const wbemFlagReturnImmediately = 16<br \/>\nConst wbemFlagForwardOnly = 32<br \/>\nlFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly<br \/>\nstrService = &#8220;winmgmts:{impersonationlevel=impersonate}\/\/&#8221;<br \/>\nstrComputer = &#8220;.&#8221;<br \/>\nstrNamespace = &#8220;\/root\/HP\/InstrumentedBIOS&#8221;<br \/>\nstrQuery = &#8220;select * from HP_BIOSSettingInterface&#8221;<br \/>\nSet objWMIService = GetObject(strService &amp; _<br \/>\nstrComputer &amp; strNamespace)<br \/>\nSet colItems = objWMIService.ExecQuery(strQuery,,lFlags)<br \/>\nFor each objItem in colItems<br \/>\nobjItem.SetBiosSetting oReturn, _<br \/>\n&#8220;Setup Password&#8221;,\u00a0_<br \/>\n&#8220;&lt;kbd\/&gt;191E1F1F11181320&#8221;<br \/>\nNext<br \/>\n<\/em><br \/>\n2. The following script changes the Bios password from <em>&#8216;password&#8217;\u00a0 <\/em>to <em>123&#8242;<\/em><\/p>\n<p><em>Const wbemFlagReturnImmediately = 16<br \/>\nConst wbemFlagForwardOnly = 32<br \/>\nlFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly<br \/>\nstrService = &#8220;winmgmts:{impersonationlevel=impersonate}\/\/&#8221;<br \/>\nstrComputer = &#8220;.&#8221;<br \/>\nstrNamespace = &#8220;\/root\/HP\/InstrumentedBIOS&#8221;<br \/>\nstrQuery = &#8220;select * from HP_BIOSSettingInterface&#8221;<br \/>\nSet objWMIService = GetObject(strService &amp; _<br \/>\nstrComputer &amp; strNamespace)<br \/>\nSet colItems = objWMIService.ExecQuery(strQuery,,lFlags)<br \/>\nFor each objItem in colItems<br \/>\nobjItem.SetBiosSetting oReturn, _<br \/>\n&#8220;Setup Password&#8221;, _<br \/>\n&#8220;&lt;kbd\/&gt;020304&#8221;, _<br \/>\n&#8220;&lt;kbd\/&gt;191E1F1F11181320&#8221;<br \/>\nNext<\/em><\/p>\n<p>3. The following script removes\u00a0Bios password. In order to remove the password you still have to know what it is. In this case it is set to <em>&#8216;password&#8217;<\/em><\/p>\n<p><em>Const wbemFlagReturnImmediately = 16<br \/>\nConst wbemFlagForwardOnly = 32<br \/>\nlFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly<br \/>\nstrService = &#8220;winmgmts:{impersonationlevel=impersonate}\/\/&#8221;<br \/>\nstrComputer = &#8220;.&#8221;<br \/>\nstrNamespace = &#8220;\/root\/HP\/InstrumentedBIOS&#8221;<br \/>\nstrQuery = &#8220;select * from HP_BIOSSettingInterface&#8221;<br \/>\nSet objWMIService = GetObject(strService &amp; _<br \/>\nstrComputer &amp; strNamespace)<br \/>\nSet colItems = objWMIService.ExecQuery(strQuery,,lFlags)<br \/>\nFor each objItem in colItems<br \/>\nobjItem.SetBiosSetting oReturn, _<br \/>\n&#8220;Setup Password&#8221;, _<br \/>\n&#8220;&lt;kbd\/&gt;&#8221;, _<br \/>\n&#8220;&lt;kbd\/&gt;191E1F1F11181320&#8221;<br \/>\nNext<\/em><\/p>\n<p>This only been tested on HP laptops and desktops(nc6400,nc6220, 6910p, dc7600). Also <a href=\"http:\/\/h20000.www2.hp.com\/bizsupport\/TechSupport\/SoftwareDescription.jsp?lang=en&amp;cc=us&amp;prodTypeId=12454&amp;prodSeriesId=316720&amp;prodNameId=316722&amp;swEnvOID=1093&amp;swLang=13&amp;mode=2&amp;taskId=135&amp;swItem=ir-46131-1\">HP CIM<\/a> must be installed.<\/p>\n<p>Feel free to post you comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many people were looking how to change the Bios password remotely. Please read my previous post about the Bios settings. To set Bios\u00a0password you will need Key scan codes the information about them is also given in my previous post.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[50,66,488,207,223,232],"_links":{"self":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/256"}],"collection":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/comments?post=256"}],"version-history":[{"count":1,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":877,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/256\/revisions\/877"}],"wp:attachment":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/media?parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/categories?post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/tags?post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}