IFPCAlertAction::Parameters property
Applies to: desktop apps only
The Parameters property gets an array of strings that specifies the parameters for the action.
This property is read-only.
Syntax
HRESULT get_Parameters(
VARIANT *pvarParameters
);
' Data type: Variant
Property Parameters( _
ByVal pvarParameters As VARIANT _
) As Variant
Property value
Variant containing an array of strings that specifies the parameters for the action.
Error codes
This property method returns S_OK if the call is successful; otherwise, it returns an error code.
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 email 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".
Examples
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
Requirements
Minimum supported client |
Windows Vista |
Minimum supported server |
Windows Server 2008 R2, Windows Server 2008 with SP2 (64-bit only) |
Version |
Forefront Threat Management Gateway (TMG) 2010 |
IDL |
Msfpccom.idl |
DLL |
Msfpccom.dll |
See also
Build date: 7/12/2010