Edit

Share via


Set-NlbClusterPortRule

Edits the port rules for a NLB cluster.

Syntax

NonPipeline (Default)

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

Pipeline

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Host, HN, H

Parameter sets

NonPipeline
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies an array of cluster port rules that this cmdlet sets.

Parameter properties

Type:

PortRule[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Pipeline
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-InterfaceName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Interface, IN, I

Parameter sets

NonPipeline
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IP

Specifies the IP address for the cluster port rule to set.

Parameter properties

Type:IPAddress
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

NonPipeline
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewAffinity

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

  • Network
  • None
  • Single

Parameter properties

Type:PortRuleAffinity
Default value:None
Accepted values:None, Single, Network
Supports wildcards:False
DontShow:False
Aliases:NA

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewEndPort

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:NEP

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewIP

Specifies the new IP address for the cluster port rule.

Parameter properties

Type:IPAddress
Default value:None
Supports wildcards:False
DontShow:False
Aliases:NIP

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewMode

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

  • Disabled
  • Multiple
  • Single

Parameter properties

Type:PortRuleFilteringMode
Default value:None
Accepted values:Single, Multiple, Disabled
Supports wildcards:False
DontShow:False
Aliases:NM

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewProtocol

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

  • Both
  • Tcp
  • Udp

Parameter properties

Type:PortRuleProtocol
Default value:None
Accepted values:Tcp, Udp, Both
Supports wildcards:False
DontShow:False
Aliases:NPRTCL

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewStartPort

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:NSP

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewTimeout

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

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Timeout, T

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Port

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

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:P

Parameter sets

NonPipeline
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRule

Outputs

Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRule