Share via


Alert.Computer Property

Gets or sets the name of the computer that raised the alert.

 Alert.Computer

Access

Read/Write

Return Value

String

Remarks

The Computer property is read/write when used with a new Alert object created with the ScriptContext.CreateAlert method. This property is read-only when used with an Alert object provided to the script by MOM.

When setting this property, use only NetBIOS names. Using other naming conventions can create duplicate entries in MOM for the same computer.

Examples

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

Function MakeAlertFromEvent()
    Dim objAlert
    Dim objEvent

    If (ScriptContext.IsEvent()) Then
        Set objEvent = ScriptContext.Event
        Set objAlert = ScriptContext.CreateAlert()

        objAlert.Computer = objEvent.SourceComputer
        objAlert.ComputerDomain = objEvent.SourceDomain
        objAlert.Description = objEvent.EventParameter(1)
    Else
        Set objAlert = Nothing
    End If

    Set objEvent = Nothing

    Set MakeAlertFromEvent = objAlert
End Function

Requirements

Platforms: Requires Windows 2000 or later

Version: Requires MOM 2000  or later

See Also

Alert Object