Start a Conversation

Unsolved

This post is more than 5 years old

111920

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

57 Posts

April 22nd, 2012 15:00

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

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.

57 Posts

April 24th, 2012 22:00

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

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.

57 Posts

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.

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.

6 Posts

May 8th, 2012 14:00

Looking for a working example as well.

May 9th, 2012 10:00

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

1.1K Posts

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

1.1K Posts

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.

57 Posts

May 27th, 2012 20:00

I pretty much ran into the same issue. I had resolved it at one point. I don't remember what I did and couldn't find the scripts I had used. I get the same error on a Latitude E6420.

November 14th, 2012 11:00

Having the same issue here.  I've installed OMCI 8.1 client but unable to execute 8.0 SampleWakeOnLan.vbs script.  When I execute the vbs in cmd prompt with following command: cscript.exe //nologo SampleWakeOnLAN.vbs DELL-1234, I receive following error:  SampleWakeOnLan.vbs(49, 1) (null): 0x8004103A.  I've correctly embedded the BIOS password into the script.  Line 49 in vbs script is:Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate," &_

   "AuthenticationLevel=pktprivacy}\\" & strComputerName & "\" &_

   strNameSpace & ":" & strClassName & "=" & Chr(34) & strKeyValue & Chr(34))

Will greatly appreciate if someone can assist.  Thank you.

November 19th, 2012 10:00

Would be glad if you can let us know if "wbemtest" results on the machine are appropriate. Also I hope the quickconfig command to configure winrm is already executed prior to the script execution

November 19th, 2012 11:00

Hi Sharmad,

Thank you very much for your response.  Yes, the quickconfig command to configure winrm has been executed.  From Wbemtest, I can navigate to:

strNameSpace = "root\dcim\sysman"

strComputerName = WScript.Arguments(0)

strClassName = "DCIM_BIOSEnumeration"

But cant locate following from Instance of DCIM_BIOSEnumeration:

strKeyValue = "Root/MainSystemChassis/BIOSSetupParent/BiosSetupWOL"

Thanks!

May 14th, 2013 00:00

Since the Key itself is not existing in the system, the failure is reported. Request you to

1. check in BIOS F2 scrreen if support for Wake On Lan exists.

2. Update to the latest BIOS available in support site.

Also kindly share your system hardware details so that we could verify if the Key exists.

No Events found!

Top