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
'*** 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)
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
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.
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.
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.
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?