AddServerPublishingRuleWithScopedProtocol Method of the IFPCEEPolicyRules Interface

The AddServerPublishingRuleWithScopedProtocol method creates a new FPCPolicyRule object representing a server publishing rule for a protocol with a specific scope in the collection and returns a reference to it. The scope indicates whether the referenced item is defined for the array or for the enterprise.

[C++]

Syntax

HRESULT AddServerPublishingRuleWithScopedProtocol(
  [in]   BSTR Name,
  [in]   BSTR PublishedServerIP,
  [in]   FpcItemScope ProtocolScope,
  [in]   BSTR Protocol,
  [out]  IFPCPolicyRule** ppNewRule
);

Parameters

Name
Required. BSTR that specifies the name of the new server publishing rule.
PublishedServerIP
Required. BSTR that specifies the IP address of the internal server being published.
ProtocolScope

Required. Value from the FpcItemScope enumerated type that specifies the scope of the protocol.

Protocol
Required. BSTR that specifies the protocol for the new server publishing rule.
ppNewRule

Address of an interface pointer that on return points to an IFPCPolicyRule interface representing the new server publishing rule.

Return Value

This method returns one of the following:

[Visual Basic]

Syntax

Function AddServerPublishingRuleWithScopedProtocol( _
  ByVal Name As String, _
  ByVal PublishedServerIP As String, _
  ByVal ProtocolScope As FpcItemScope, _
  ByVal Protocol As String _
) As FPCPolicyRule

Parameters

Name
Required. String that specifies the name of the new server publishing rule.
PublishedServerIP
Required. String that specifies the IP address of the internal server being published.
ProtocolScope

Required. Value from the FpcItemScope enumerated type that specifies the scope of the protocol.

Protocol
Required. String that specifies the protocol for the new server publishing rule.

Return Value

This method returns a reference to the FPCPolicyRule object if the operation is successful. Otherwise, an error is raised that can be intercepted by using an error handler.

Remarks

Server publishing rules are used when there is a network address translation (NAT) relationship defined by a network rule (FPCNetworkRule) between the network on which the clients sending requests to the published server are located (the source network) and the network on which the published server is located (the destination network). A server publishing rule uses secure network address translation (SecureNAT), which allows requests that are sent to an IP address that is valid on the source network to reach an IP address on a protected network behind the Forefront TMG computer. The server publishing rule maps a port number and an IP address (or IP addresses) on the network adapter of the Forefront TMG computer that listens for requests from the clients to a port number and an IP address on the published server. Requests that meet the conditions specified by the rule are then redirected to the IP address specified in the PublishedServerIP parameter. However, only requests that are identified as part of the protocol specified in the Protocol parameter are processed by the server publishing rule and redirected to the published server.

The name assigned to the new rule must be unique. If the AddServerPublishingRuleWithScopedProtocol method is called with the name of an existing policy rule, the method fails.

The server publishing rule defined by the FPCPolicyRule object (IFPCPolicyRule interface in C++) created can be configured by setting the properties of the FPCServerPublishingProperties object (IFPCServerPublishingProperties interface in C++) accessed through the ServerPublishingProperties property.

Before the properties of a new server publishing rule can be written to persistent storage by calling the Save method, at least one network or network set on which the Forefront TMG will listen for requests must be specified for the rule through the IPsOnNetworks or IPsOnNetworkSets property.

When an enterprise with central array management is deployed, a server publishing rule cannot be created in an array policy by calling this method if the enterprise administrator sets the EnablePublishingRules property of the FPCPolicyAssignment object (IFPCPolicyAssignment interface in C++) for the array to False (VARIANT_FALSE in C++).

Requirements

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.

See Also

FPCPolicyRules


Send comments about this topic to Microsoft

Build date: 11/30/2009

© 2008 Microsoft Corporation. All rights reserved.