Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HP Client Management Interface VB Scripting

Status
Not open for further replies.

GregNVMC

IS-IT--Management
Jul 8, 2003
19
GB
Hi,

I've just installed HP Client Management Interface v1.00c that I downloaded from the HP website. I'm running it on an HP nc6230 laptop (although this request will cover all our HP machines).

I'm trying to write a .vbs script that uses CMI to read and modify BIOS setttings. Specifically the Boot Device Order. The PDF doc that accompanies the CMI download contains a sample script for setting the boot order. I've tried running this but it doesn't work properly on my machine. I believe this is becuase I have my BIOS Setup password configured and the sample script doesn't handle this password correctly.

Please can someone help me write a vbs script that will check if a BIOS Setup password is set and reset it to our corporate standard BIOS password. I also need the script to set the default boot order to boot from Network first, then HD and then the others in the boot order after that (i.e. Multibay and Diskette).

Here's a copy of the sample vbs script so you can see what I've been working with:

<CODE/>
___________________________________

Const wbemFlagReturnImmediately = 16
Const wbemFlagForwardOnly = 32
lFlags = wbemFlagReturnImmediately + wbemFlagForwardOnly
strService = "winmgmts:{impersonationlevel=impersonate}//"
strComputer = "."
strNamespace = "/root/HP/InstrumentedBIOS"
strQuery = "select * from HP_BIOSSettingInterface"
Set objWMIService = GetObject(strService & _
strComputer & strNamespace)
Set colItems = objWMIService.ExecQuery(strQuery,,lFlags)
For each objItem in colItems
objItem.SetBiosSetting oReturn, _
"Boot Order", _
"Network Controller,Hard Drive,Multibay,Diskette", _
"<kbd/>1E302E020304"
Next
Dim strReturn
Select Case oReturn
Case 0 strReturn = "Success"
Case 1 strReturn = "Not Supported"
Case 2 strReturn = "Unspecified Error"
Case 3 strReturn = "Timeout"
Case 4 strReturn = "Failed"
Case 5 strReturn = "Invalid Parameter"
Case 6 strReturn = "Access Denied"
Case Else strReturn = "..."
End Select
WScript.Echo "SetBiosSetting() returned: (" & oReturn _
& ") " & strReturn
___________________________________
<CODE>

Please help as this is driving me nuts!!!

Many thanks in advance for any help or guidance you can give.

Kind Regards,

Greg.
 
in the documentation does it mention any methods or read/write properties for the password?


below is example code for pipin out all the avaialble properties of a returned instance.

if the documentation is rubbish and you cant find what you want from the code below then you might consider installing the WMI Browser app thing which shows instances on WMI classes on your machine with properties etc

For Each oInstance in colInstances
For Each oProp In oInstance.Properties_
If IsNull(oProp.Value) Then
strVal = "NULL"
Elseif oProp.IsArray Then
strVal = "ARRAY: " & Join(oProp.Value, ";")
Else
strVal = oProp.Value
End If
strReturn = strReturn & oProp.Name & ": " & strVal & VbCrLf
Next
strReturn = strReturn & "**************************************" & VbCrLf & VbCrLf
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top