IFPCArray::SelectNetworkTemplateAndPolicy method
Applies to: desktop apps only
The SelectNetworkTemplateAndPolicy method sets a selected network template and default policy for the array.
Syntax
HRESULT SelectNetworkTemplateAndPolicy(
[in] BSTR networkTemplate,
[in] BSTR defaultPolicy
);
FPCArray.SelectNetworkTemplateAndPolicy( _
ByVal networkTemplate As String, _
ByVal defaultPolicy As String _
)
Parameters
networkTemplate [in]
String value that specifies the name of the network template to be used. This parameter must be set to the value held in the Name property of an FPCNetworkTemplate object that is defined in the array.defaultPolicy [in]
String value that specifies the name of the default firewall policy to be used. This parameter must be set to the value held in the Name property of an FPCPolicyInTemplate object that is included in the collection of policies held in the PoliciesInTemplate property of the FPCNetworkTemplate object specified in the networkTemplate parameter.
Return value
C++
This method returns S_OK if the call is successful; otherwise, it returns an error code.
VB
This method has no return values. If the call is unsuccessful, an error is raised that can be intercepted by using an error handler.
Remarks
This method sets the NetworkTemplateUsed property of the array.
This method deletes all existing networks, network rules, and policy rules (except system policy rules), and replaces them with the network topology and rules defined by the network template and default policy selected.
We recommend that you export your Forefront TMG configuration before calling this method.
Examples
This VBScript script applies a network template and a default firewall policy. Note that the Save method does not need to be called to apply the changes.
' Specify the names of a network template
' and a default firewall policy as constants.
Const TemplateName = "Edge Firewall"
Const PolicyName = "Block all"
' Declare the other objects needed.
Dim root ' An FPC object
Dim isaArray ' An FPCArray object
' Create the root obect.
Set root = CreateObject("FPC.Root")
' Get a reference to the array object.
Set isaArray = root.GetContainingArray()
' Apply the specified network template and default firewall policy.
isaArray.SelectNetworkTemplateAndPolicy TemplateName, PolicyName
WScript.echo "The network template " & _
isaArray.NetworkTemplateUsed.Name & " was applied."
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