Microsoft Operations Manager

SourceComputer Property (Event)

The SourceComputerproperty gets the name of the computer that generated the event.

[VBScript] Event.SourceComputer

Access

Read/Write

Return Value

String

Remarks

The SourceComputerproperty is read-only when used with an event provided to the script by MOM. The property is read/write when used with a new event created with the ScriptContext.CreateEventmethod.

Examples

The following example sets the SourceComputerproperty based on the event that caused MOM to invoke the script. The SourceComputerproperty is set to the name of the computer that generated the event.

[VBScript] 
Function MakeEventFromEvent()
	Dim objSourceEvent
	Dim objNewEvent

	Set objSourceEvent = ScriptContext.Event
	Set objNewEvent = ScriptContext.CreateEvent()

	objNewEvent.LoggingDomain = "DOMAIN1"

	objNewEvent.UTCTime = objSourceEvent.UTCTime
	objNewEvent.UserName = objSourceEvent.UserName
	objNewEvent.SourceComputer = objSourceEvent.SourceComputer
	objNewEvent.Message = objSourceEvent.Message
	objNewEvent.MessageDLL = objSourceEvent.MessageDLL
	objNewEvent.LoggingComputer = objSourceEvent.LoggingComputer

	Set objSourceEvent = Nothing

	Set MakeEventFromEvent = objNewEvent
End Function

Requirements

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

See Also

Event Object


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