Share via


Alert.ComputerDomain Property

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

 Alert.ComputerDomain

Access

Read/Write

Return Value

String

Remarks

The ComputerDomain property is read/write when used with a new alert 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 ComputerDomain property based on the event that caused MOM to invoke the script. The ComputerDomain property is set to the name of the domain to which the computer that logged the event belongs.

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