Share via


Alert.Name Property

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

 Alert.Name

Access

Read/Write

Return Value

String

Remarks

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

Examples

The following example sets the Name property based on the alert that caused MOM to invoke the script. The Name property is set to the name of the rule that raised the alert.

Function CreateNewAlert()
    Dim objCreatedAlert
    Dim objAlert

    Set objCreatedAlert = ScriptContext.CreateAlert()

    If (ScriptContext.IsAlert()) Then
        Set objAlert = ScriptContext.Alert

        objCreatedAlert.Name = objAlert.Name
        objCreatedAlert.AlertLevel = 50
        objCreatedAlert.Owner = "[unassigned]"
        objCreatedAlert.ResolutionState = 0  ' New
    Else
        Set objCreatedAlert = Nothing
    End If

    Set objAlert = Nothing

    Set CreateNewAlert = objCreatedAlert
End Function

Requirements

Platforms: Requires Windows 2000 or later

Version: Requires MOM 2000  or later

See Also

Alert Object