{"id":12,"date":"2008-01-18T16:37:21","date_gmt":"2008-01-18T16:37:21","guid":{"rendered":"http:\/\/andrius.kozeniauskas.com\/blog\/?p=12"},"modified":"2012-04-20T12:46:25","modified_gmt":"2012-04-20T11:46:25","slug":"remotely-change-bios-settings","status":"publish","type":"post","link":"http:\/\/www.kozeniauskas.com\/itblog\/2008\/01\/18\/remotely-change-bios-settings\/","title":{"rendered":"HP: Remotely change BIOS settings with script"},"content":{"rendered":"<p>Couple months ago I\u00a0needed to change BIOS setting on all our HP laptops. I wanted to do that remotely because we have many laptops and they are in 5 different locations. After spending some time searching I found very good document from HP.<br \/>\n<a href=\"http:\/\/h20331.www2.hp.com\/Hpsub\/downloads\/cmi_whitepaper.pdf\" target=\"_blank\"><span style=\"color: #0000cc;\">HP Client Management Interface Technical White Paper<\/span><\/a><!--more--><\/p>\n<p>After some modifications I came up with the following VB script. This script enables <em>LAN\/WLAN Switching <\/em>setting in the BIOS. Because all the laptops are password protected I had to\u00a0include BIOS password in the script. The password line is <em>&#8220;&lt;kbd\/&gt;191E1F1F11181320&#8221;<\/em> which is <em>password.<\/em> As described in the HP document: &#8216;kbd&#8217; denotes a string in hexadecimal format containing keyboard scan code input.<br \/>\nYou can find keyboard scan codes <a href=\"https:\/\/www.glue.umd.edu\/~nsw\/ench250\/scancode.htm\" target=\"_blank\">here<\/a>. Once I had the script I&#8217;ve used SMS2003 to deployed on the laptops. You can easely Active Directory to run the script on start-up.<\/p>\n<p>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;LAN\/WLAN Switching&#8221;, _<br \/>\n&#8220;Enable&#8221;, _<br \/>\n&#8220;&lt;kbd\/&gt;191E1F1F11181320&#8221;<br \/>\nNext<\/p>\n<p><a href=\"http:\/\/www.kozeniauskas.com\/itblog\/wp-content\/uploads\/2008\/01\/bios-change.vbs\" target=\"_blank\">Download<\/a><\/p>\n<p>Also I&#8217;ve wrote a script which will list all setting in the BIOS. It will also show possible options for setting and which one is set. This creates a *.txt file.<\/p>\n<p>Dim objFileSystem, objOutputFile<br \/>\nDim strOutputFile<br \/>\nConst wbemFlagReturnImmediately = 16<br \/>\nConst wbemFlagForwardOnly = 32<br \/>\nlFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly<br \/>\nstrOutputFile = &#8220;.\/&#8221; &amp; Split(WScript.ScriptName, &#8220;.&#8221;)(0) &amp; &#8220;.txt&#8221;<br \/>\nstrService = &#8220;winmgmts:{impersonationlevel=impersonate}\/\/&#8221;<br \/>\nstrComputer = &#8220;.&#8221;<br \/>\nstrNamespace = &#8220;\/root\/HP\/InstrumentedBIOS&#8221;<br \/>\nstrQuery = &#8220;select * from HP_BIOSSetting&#8221;<br \/>\nSet objFileSystem = CreateObject(&#8220;Scripting.fileSystemObject&#8221;)<br \/>\nSet objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE)<br \/>\nSet objWMIService = GetObject(strService &amp; strComputer &amp; _<br \/>\nstrNamespace)<br \/>\nSet colItems = objWMIService.ExecQuery(strQuery,,lFlags)<br \/>\nCounter = 1<br \/>\nFor Each objItem In colItems<br \/>\nobjOutputFile.WriteLine(Counter &amp; vbTab &amp; objItem.Name &amp; _<br \/>\n&#8221;\u00a0\u00a0 =\u00a0\u00a0 &#8221; &amp; objItem.Value)<br \/>\nCounter = Counter + 1<br \/>\nNext<br \/>\nobjOutputFile.Close<br \/>\nSet objFileSystem = Nothing<\/p>\n<p><a href=\"http:\/\/www.kozeniauskas.com\/itblog\/wp-content\/uploads\/2008\/01\/bios-setting.vbs\" target=\"_blank\">Download<\/a><\/p>\n<p>Scripts were tested on HP Compaq nc6400 and HP Compaq\u00a06910p\u00a0laptops, both of them running WinXP SP2. The second script was also tested on HP dc7600 ultra slim PC.<\/p>\n<p>Note: I&#8217;ve found out that some desktops and laptops (like nc6220) does not have CMI installed and the scripts don&#8217;t work without CMI. You can download it from <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\" target=\"_blank\">here. (SP33341)<\/a><\/p>\n<p>Update: For all of you who want to change Bios password I&#8217;ve created a separe post about it.\u00a0<a href=\"http:\/\/andrius.kozeniauskas.com\/blog\/2008\/09\/24\/hp-remotely-change-bios-password-with-a-script\/\">Remotely change Bios password with a script<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Couple months ago I\u00a0needed to change BIOS setting on all our HP laptops. I wanted to do that remotely because we have many laptops and they are in 5 different locations. After spending some time searching I found very good document from HP. HP Client Management Interface Technical White Paper<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[51,66,69,488,206,207,223],"_links":{"self":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/12"}],"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=12"}],"version-history":[{"count":2,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":878,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/posts\/12\/revisions\/878"}],"wp:attachment":[{"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kozeniauskas.com\/itblog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}