Share via


Parameters Property of the IFPCAlertAction Interface

The Parameters property gets an array of strings that specifies the parameters for the action.

C++

HRESULT get_Parameters(
    VARIANT* pvarParameters
);

Parameters

  • pvarParameters
    Pointer to a VARIANT that is set on return to a VARIANT containing an array of strings that specifies the parameters for the action.

Return Value

This property method returns S_OK if the call is successful; otherwise, it returns an error code.

Visual Basic

Property Parameters As Variant

Property Value

Variant containing an array of strings that specifies the parameters for the action.

Example Code

This VBScript script displays the parameters of the alert actions for the user-specified alert.

' Define the constant needed
const Error_FileNotFound = &H80070002
Main(WScript.Arguments)
Sub Main(args)
    If(args.Count = 1) Then
        ShowAlertActions args(0)
    Else
        Usage()
    End If
End Sub
Sub ShowAlertActions(alertName)
    ' Create the root object.
    Dim root  ' The FPCLib.FPC root object
    Set root = CreateObject("FPC.Root")
    ' Declare the other objects needed.
    Dim isaArray        ' An FPCArray object
    Dim alert           ' An FPCAlert object
    Dim actions         ' An FPCAlertActions collection
    Dim action          ' An FPCAlertAction object
    Dim parameters      ' A Variant
    Dim parameter       ' A String
    ' Get a reference to the local array object.
    Set isaArray = root.GetContainingArray()
    ' Get a reference to the alert specified.
    On Error Resume Next
    Set alert = isaArray.Alerts.Item(alertName)
    If Err.Number = Error_FileNotFound Then
        WScript.Echo "The alert specified could not be found."
    Else
        Err.Clear
        On Error GoTo 0
        Set actions = alert.Actions
        For Each action In actions
            WScript.Echo "Action: " & action.Name
            parameters = action.Parameters
            For Each parameter In parameters
                WScript.Echo "Parameter: " & parameter
            Next
        Next 
    End If
End Sub
Sub Usage()
    WScript.Echo "Usage:" & VbCrLf _
        & "  CScript " & WScript.ScriptName & " Alert Command" & VbCrLf _
        & "" & VbCrLf _
        & "    Alert - Name of the alert" 
    WScript.Quit
End Sub

Remarks

This property is read-only. The parameters are set by calling the methods of the FPCAlertActions collection (the IFPCAlertActions interface in C++).

The following table shows the values of the parameters for actions of different types.

Type param1 param2 param3 param4
Log event None None None None
Command Command line None None None
Stop/start service Service name Service name Service name Service name
Send mail SERVER= x, where x is an address or IP of an SMTP mail server TO= x, where x is a space-delimited list of To recipients CC= x, where x is a space-delimited list of Cc recipients FROM= x, where x is a valid e-mail address of the sender

Note  If the parameters of an action include a command line and the path to the executable file contains one or more spaces, the full path, including the name of the executable file, is enclosed in double quotation marks in addition to the set of quotation marks that enclose the string defining the command line. For example, if the full path to the excecutable file is C:\Program Files\Microsoft ISA Server\Myalertscript.cmd, the string defining the command line is written in the form """C:\Program Files\Microsoft ISA Server\Myalertscript.cmd""". If the command line also includes a parameter, the string defining the command line is written in the form """C:\Program Files\Microsoft ISA Server\Myalertscript.cmd"" parameter".

Requirements

Client Requires Windows 7 or Windows Vista.
Server Requires Windows Server 2008 R2 or Windows Server 2008 x64 Edition with SP2.
Version Requires Forefront Threat Management Gateway (TMG) 2010.
IDL

Declared in Msfpccom.idl.

DLL

Requires Msfpccom.dll.

See Also

FPCAlertAction

Send comments about this topic to Microsoft

Build date: 6/30/2010