Get-NlbClusterPortRule

Gets the port rule objects that are queried by the caller.

Syntax

Get-NlbClusterPortRule
   [-HostName <String>]
   [-InterfaceName <String>]
   [-IP <IPAddress>]
   [[-Port] <UInt32>]
   [-NodeName <String>]
   [<CommonParameters>]
Get-NlbClusterPortRule
   -InputObject <PSObject[]>
   [-IP <IPAddress>]
   [[-Port] <UInt32>]
   [<CommonParameters>]

Description

The Get-NlbClusterPortRule cmdlet gets the port rules in the Network Load Balancing (NLB) cluster. If a port number is not specified, all port rules configured for the cluster are listed.

Examples

Example 1: List all port rules on the local cluster

PS C:\>Get-NlbClusterPortRule
IPAddress State     Start     End       Protocol  Mode      Affinity  Timeout 
--------- -----     -----     ---       --------  ----      --------  ------- 
All       Enabled   0         65535     Both      Multiple  Single    0

This command lists all the port rules on the local cluster.

Example 2: Get a port rule for a specific port

PS C:\>Get-NlbClusterPortRule -Port 80
IPAddress State     Start     End       Protocol  Mode      Affinity  Timeout 
--------- -----     -----     ---       --------  ----      --------  ------- 
All       Enabled   0         65535     Both      Multiple  Single    0

This command gets the port rule that includes port 80.

Example 3: Get port rules from all cluster nodes

PS C:\>Get-NlbClusterNode | Get-NlbClusterPortRule | Format-List -Property *
Cluster          : mycluster 
NodeName         : node1 
VirtualIPAddress : 255.255.255.255 
StartPort        : 0 
EndPort          : 65535 
Affinity         : 
FilteringMode    : Single 
Protocol         : Both 
EqualLoad        : False 
LoadWeight       : 
PortState        : Enabled 
Priority         : 1 
Timeout          : 

Cluster          : mycluster 
NodeName         : node2 
VirtualIPAddress : 255.255.255.255 
StartPort        : 0 
EndPort          : 65535 
Affinity         : 
FilteringMode    : Single 
Protocol         : Both 
EqualLoad        : False 
LoadWeight       : 
PortState        : Enabled 
Priority         : 2 
Timeout          :

This command gets the port rule from all cluster nodes. This is especially useful if there are port rules that have Single mode.

Parameters

-HostName

Specifies the name of the cluster host against which this cmdlet is run. If this parameter is omitted or a value of . is entered, then the local cluster is assumed.

Type:String
Aliases:Host, HN, H
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Specifies an array of cluster or cluster nodes for which port rules are enumerated.

Type:PSObject[]
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-InterfaceName

Specifies the interface to which NLB is bound. This is the interface of the cluster against which this cmdlet is run.

Type:String
Aliases:Interface, IN, I
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-IP

Specifies the IP address for the cluster port rule that this cmdlet gets.

Type:IPAddress
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NodeName

Specifies the name of the cluster node for which port rules are enumerated.

Type:String
Aliases:NN
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Port

Specifies a port number within the port rule that this cmdlet gets. The acceptable values for this parameter are: 0 through 65535.

Type:UInt32
Position:0
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.Cluster

Outputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRule