Set-NlbClusterPortRule

Edits the port rules for a NLB cluster.

Syntax

Set-NlbClusterPortRule
   [-HostName <String>]
   [-InterfaceName <String>]
   [-IP <IPAddress>]
   [[-Port] <UInt32>]
   [-NewIP <IPAddress>]
   [-NewProtocol <PortRuleProtocol>]
   [-NewStartPort <Int32>]
   [-NewEndPort <Int32>]
   [-NewMode <PortRuleFilteringMode>]
   [-NewAffinity <PortRuleAffinity>]
   [-NewTimeout <UInt32>]
   [<CommonParameters>]
Set-NlbClusterPortRule
   -InputObject <PortRule[]>
   [-NewIP <IPAddress>]
   [-NewProtocol <PortRuleProtocol>]
   [-NewStartPort <Int32>]
   [-NewEndPort <Int32>]
   [-NewMode <PortRuleFilteringMode>]
   [-NewAffinity <PortRuleAffinity>]
   [-NewTimeout <UInt32>]
   [<CommonParameters>]

Description

The Set-NlbClusterPortRule cmdlet edits the port rules for a Network Load Balancing (NLB) cluster. The port rule configuration you can edit includes the cluster IP address, port range, protocols, filtering mode, affinity, load weight, handling priority, and timeout.

This operation changes the configuration on all cluster nodes. As a result, the NLB cluster will have to restart the convergence process on all nodes to guarantee that configuration changes have been applied on all nodes and that a consistent state is reached. Any additional operations on the NLB cluster should not be initiated until all cluster nodes have completed the convergence process and are back to the converged state.

ps_nlbc_checkstate_remark

Examples

Example 1: Change the start port of a port rule

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

This command changes the start port of the port rule of port number 80 to 5.

Example 2: Change the protocol of a port rule

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

This command changes the protocol of the port rule of port number 80 to TCP.

Example 3: Change the port rule mode

PS C:\>Get-NlbClusterPortRule 80 | Set-NlbClusterPortRule -NewMode Single
IPAddress State     Start     End       Protocol  Mode      Affinity  Timeout 
--------- -----     -----     ---       --------  ----      --------  ------- 
All       Enabled   5         65535     Tcp       Single              0

This command changes the port rule mode to Single.

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 port rules that this cmdlet sets.

Type:PortRule[]
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 to set.

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

-NewAffinity

Specifies the new affinity for the cluster port rule. The acceptable values for this parameter are:

  • Network
  • None
  • Single
Type:PortRuleAffinity
Aliases:NA
Accepted values:None, Single, Network
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewEndPort

Specifies the new end port for the cluster port rule. The acceptable values for this parameter are: 0 through 65535.

Type:Int32
Aliases:NEP
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewIP

Specifies the new IP address for the cluster port rule.

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

-NewMode

Specifies a new mode for the cluster port rule. The acceptable values for this parameter are:

  • Disabled
  • Multiple
  • Single
Type:PortRuleFilteringMode
Aliases:NM
Accepted values:Single, Multiple, Disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewProtocol

Specifies the new protocol for the cluster port rule. The acceptable values for this parameter are:

  • Both
  • Tcp
  • Udp
Type:PortRuleProtocol
Aliases:NPRTCL
Accepted values:Tcp, Udp, Both
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewStartPort

Specifies the new start port for the cluster port rule. The acceptable values for this parameter are: 0 through 65535.

Type:Int32
Aliases:NSP
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NewTimeout

Specifies the new timeout in minutes for the cluster port rule. The acceptable values for this parameter are: 0 through 240.

Type:UInt32
Aliases:Timeout, T
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Port

Specifies a port number within the port rule to set. The acceptable values for this parameter are: 0 through 65535.

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

Inputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRule

Outputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRule