The SelectNetworkTemplateAndPolicy method sets a selected network template and default policy for the array.
HRESULT SelectNetworkTemplateAndPolicy( [in] BSTR networkTemplate, [in] BSTR defaultPolicy );
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.
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.
This method returns S_OK if the call is successful; otherwise, it returns an error code.
Sub SelectNetworkTemplateAndPolicy( _ ByVal networkTemplate As String, _ ByVal defaultPolicy As String _ )
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.
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.
' 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."
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.
Client | Requires Windows Vista or Windows XP. |
---|---|
Server | Requires Windows Server 2008. |
Version | Requires Forefront Threat Management Gateway (TMG). |
IDL |
Declared in Msfpccom.idl. |
DLL |
Requires Msfpccom.dll. |
Send comments about this topic to Microsoft
Build date: 11/30/2009
© 2008 Microsoft Corporation. All rights reserved.