UNSOLVED

Jajohnson69

updated

15 years ago

0

112206

April 20th, 2012 11:00

OMCI 8 VBS Sample Scripts Error\don't work

Hi,

None of the OMCI sample scripts seem to work.  Consistently I get Invalid parameter - swbemobjectex error for the line:

Set returnValue = objInstance.ExecMethod_("SetBIOSAttributes", oInParams)

WMI is know to be working on the machine as other WMI scripts work.

I tried uninstalling\reinstalling OMCI 8 on several machines.

I tried install OMCI 7.6 and 8 togher.

I tried removing the authorization part of the script as I have no BIOS passwords.

I see other people have posted this issue on the forums with no resolution.  Can someone assist ? 

Which class has "Chassis Intrustion Status" reported ?  It's not in the documentation , only for OMCI legacy versions.

Here is the script that generates the invalid parameter error.

'**********************************************************************
'*** Name: SampleChassisIntrusionClear.vbs
'*** Purpose: To clear the chassis intrusion status on a Dell OMCI client.
'*** Usage: cscript.exe //nologo SampleChassisIntrusionClear.vbs
'***
'*** This sample script is provided as an example only, and has not been
'*** tested, nor is warranted in any way by Dell; Dell disclaims any
'*** liability in connection therewith. Dell provides no technical
'*** support with regard to such scripting. For more information on WMI
'*** scripting, refer to applicable Microsoft documentation.

'*** NOTE: Replace in line 57 (inside the quotes)
'*** with the desired values if there is any password set in the system.
'*** If both passwords(Admin and Boot) are set please replace it with Admin Password.
'*** If there is no password set in the system please leave it as empty.
'**********************************************************************

Option Explicit

'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strKeyValue
Dim objInstance
Dim strPropName
Dim strPropValue
Dim oInParams
Dim objWMIService
Dim returnValue
Dim ColSystem
Dim strAttributeName(2)
Dim strAttributeValue(2)
'Dim strAuthorizationToken

'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count < 1) Then
Call Usage()
WScript.Quit
End If

'*** Initialize variables
strNameSpace = "root/dcim/sysman"
strComputerName = WScript.Arguments(0)
strClassName = "DCIM_BIOSService"
strAttributeName(0) = "Chassis Intrusion Status"

'*** All possible values for Chassis Intrusion Status are as follows:
'*** 1 = Tripped (Read-only)
'*** 2 = Door open (Read-only)
'*** 3 = Door closed (Read-only)
'*** 4 = Trip reset (Write-only)

strAttributeValue(0) = "4"
'strAuthorizationToken = " "

returnValue = 0
'*** Retrieve the instance of DCIM_BIOSService class
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate," &_
"AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_
strNameSpace)
Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)

For each objInstance in ColSystem
Set oInParams= objInstance.Methods_("SetBIOSAttributes").InParameters.SpawnInstance_
oInParams.AttributeName = strAttributeName
oInParams.AttributeValue = strAttributeValue
'oInParams.AuthorizationToken = strAuthorizationToken
Set returnValue = objInstance.ExecMethod_("SetBIOSAttributes", oInParams)
Next

'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Clear chassis intrusion failed."
End If

'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe /nologo SampleChassisIntrusionClear.vbs "
WScript.Echo strMessage
End Sub

-thanks

  • Clint11

    1 Rookie

    •

    57 Posts

    2814

    0

    Posted April 22nd, 2012 15:00

    What model are you running this on and what version of BIOS is installed?

  • 2814

    0

    Posted April 23rd, 2012 06:00

    Hi Clint,

    My test machines are:

    Desktop Optiplex 990 - BIOS version A06

    Laptop Latitude E6420 - BIOS version A08

    Thanks for your response.

  • Clint11

    1 Rookie

    •

    57 Posts

    2814

    0

    Posted April 24th, 2012 22:00

    If you install CCTK and run cctk.exe --chasintrusion then what happens?

  • 2814

    0

    Posted April 25th, 2012 09:00

    Hi Clint,

    It's not about chassis intrusion.  It's about the scripts.  ALL of the sample scripts that apply a setting error out on Set returnValue = objInstance.ExecMethod_("SetBIOSAttributes", oInParams) with invalid parameter.  None of them that use this method work.  I'm just using the chassis intrusion script for an example.

    Why doesn't this method work ?  What am I missing here ?  I've tried it on many machines where I know WMI is working.  I have run other WMI scripts (non OMCI) that work fine.  WMI is not broken.

    Either the script are wrong and the documentation on the method is wrong or I am missing something.

    I see other people with this issue with no resolution.  I just need one working example and I can write all the scripts I need.  I've had other people on my team look at this and they can't figure out the right syntax for the method either.

    We do not use a BIOS password. I've tried the scirpts with and without the BIOS autorization portion so that's not it.

    thanks for your response !  sorry I wasn't clear with my first post.

  • Clint11

    1 Rookie

    •

    57 Posts

    2814

    0

    Posted April 30th, 2012 18:00

    I'd vaguely remember experiencing a similar issue like this with a different script but at the same line of code. I'll have to check tomorrow to see if I can find the scripts I wrote but I'm pretty sure I had to change something to get it to work correctly.

  • 2814

    0

    Posted May 1st, 2012 08:00

    Thanks for looking Clint.  One good sample is all I need !  I'm not sure what to change at this point.

  • jspanitz

    6 Posts

    2814

    0

    Posted May 8th, 2012 14:00

    Looking for a working example as well.

  • 2819

    0

    Posted May 9th, 2012 10:00

    Still having the issue.  Any ideas on what Warren has that I don't ?  any requirements other than OMCI ?

  • DELL-Warren B

    1 Rookie

    •

    1124 Posts

    2814

    0

    Posted May 9th, 2012 10:00

    OMCI 8.1 is available today.  The 8.0 script samples should apply.  I tested the WOL script and it worked for me.

    en.community.dell.com/.../1773.openmanage-client-instrumentation-omci.aspx

  • DELL-Warren B

    1 Rookie

    •

    1124 Posts

    1647

    0

    Posted May 9th, 2012 13:00

    The only change I made to the script was to remove the from the Bios password config since I don't have a bios password set.  I left the two quote marks for essentially a blank entry.