Microsoft Operations Manager

CreateEvent Method

The CreateEventmethod generates a new Eventobject.

[VBScript] ScriptContext.CreateEvent()

Return Value

Object (Event)

Remarks

The Eventobject returned by this method is initially empty. After creating the new Eventobject, assign a value to it using the ScriptContext.Eventproperty. The Eventobject can then be sent to the MOM data stream using the ScriptContext.Submitmethod.

Examples

The following example shows how to generate a new Eventobject.

[VBScript] 
Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR   = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
Const EVENT_TYPE_AUDITSUCCESS = 8
Const EVENT_TYPE_AUDITFAILURE = 16

Function MakeEvent()
	Dim objEvent
 
	Set objEvent = ScriptContext.CreateEvent()

	objEvent.EventSource = "TestScript"
	objEvent.EventNumber = 1349
	objEvent.EventType = EVENT_TYPE_WARNING
	objEvent.LoggingDomain = "DOMAIN1"
	objEvent.SourceDomain = "DOMAIN1"

	Set MakeEvent = objEvent
End Function

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

ScriptContext Object, ScriptContext.Event Property, ScriptContext.Submit Method, Event Object


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.