Users Guide

(Wscript.Arguments.Count < 1) Then
Call Usage()
WScript.Quit
End If
'*** 初始化变量
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_IndicationStaticValues"
strPropName = "MaxDisplayNotifications"
'*** 建立与 DellOMCI 名称空间的连接 Set objWMIService =GetObject("winmgmts:{impersonationLevel=impersonate," &_ "AuthenticationLevel=pktprivacy}
\\" & strComputerName & "\" &_ strNameSpace)
'*** 检索 '***Dell_IndicationStaticValues 类的实例(应有 16 个实例 – 每种警报类型一个实例)。
Set ColSystem=objWMIService.execquery ("Select * from " & strClassName)
For each objInstance in ColSystem
'*** MaxDisplayNotifications 的值设置为 '0' '*** 设置属性的新值并保存实例 objInstance.Properties_.Item(strPropName).Value = 0 objInstance.Put_
Next
'*** 如果出现任何错误,让用户知道。
If Err.Number <> 0 Then
WScript.Echo "属性更改失败。"
End If
'*** Sub 用于显示脚本的 '***正确用法
Sub Usage()
Dim strMessage
strMessage = "语法不正确。应运行:" & vbCRLF & _ "cscript.exe /nologo SampleDisableAlertMessages.vbs <系统名称>" WScript.Echo strMessage
End Sub)
关闭远程系
下面是将远程关闭 Dell™OMCI客户端的示例 VBScript
'****************************************************
'*** Name: SampleShutdown.vbs
'*** Purpose: To shut down a Dell™ OMCI client.
'*** Usage: cscript.exe //nologo SampleShutdown.vbs <systemname>
'***
'*** 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.
'****************************************************
Option Explicit
'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strPropValue
Dim objInstance
Dim ObjOutParam
Dim strMethod
'*** 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