Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Edits the port rules for an NLB cluster.
Set-NlbClusterPortRule [[-Port] <System.Nullable`1[[System.UInt32>] [-HostName <string>] [-InterfaceName <string>] [-IP <IPAddress>] [-NewAffinity <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleAffinity>] [-NewEndPort <System.Nullable`1[[System.Int32>] [-NewIP <IPAddress>] [-NewMode <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleFilteringMode>] [-NewProtocol <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleProtocol>] [-NewStartPort <System.Nullable`1[[System.Int32>] [-NewTimeout <System.Nullable`1[[System.UInt32>] [<CommonParameters>]
Set-NlbClusterPortRule -InputObject <PortRule[]> [-NewAffinity <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleAffinity>] [-NewEndPort <System.Nullable`1[[System.Int32>] [-NewIP <IPAddress>] [-NewMode <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleFilteringMode>] [-NewProtocol <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleProtocol>] [-NewStartPort <System.Nullable`1[[System.Int32>] [-NewTimeout <System.Nullable`1[[System.UInt32>] [<CommonParameters>]
The Set-NlbClusterPortRule cmdlet edits the port rules for an NLB cluster. The port rule configuration you can edit include 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. To check the state of all cluster nodes, use the Get-NlbClusterNode cmdlet. If a configuration change results in the cluster nodes remaining in perpetual convergence, refer to the event log to resolve the configuration inconsistency between the cluster nodes.
Specifies the name of the cluster host against which this cmdlet is run. If this parameter is omitted or if "-HostName ." is used, the local cluster is assumed. [Alias: hn]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the cluster port rule to set.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByValue, ByPropertyName) |
Position? |
named |
Specifies the interface to which NLB is bound. This is the interface of the cluster against which this cmdlet is run.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the IP address for the cluster port rule to set.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-NewAffinity <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleAffinity>
Specifies the new affinity for the cluster port rule. There are three possible values for port rule affinity: none, single, and network. [Alias: na]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the new end port for the cluster port rule. The acceptable range is between 0 and 65535. [Alias: nep]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the new IP address for the cluster port rule. [Alias: nip]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-NewMode <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleFilteringMode>
Specifies a new mode for the cluster port rule. There are three possible filtering modes: multiple hosts, single host, and disabled. [Alias: nm] [Valid set: single multiple disabled]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-NewProtocol <System.Nullable`1[[Microsoft.NetworkLoadBalancingClusters.PowerShell.PortRuleProtocol>
Specifies the new protocol for the cluster port rule. There are three possible protocols: tcp, udp, and both. [Alias: nprtcl]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the new start port for the cluster port rule. The acceptable range is between 0 and 65535. [Alias: nsp]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies the new timeout in minutes for the cluster port rule. The acceptable range is between 0 and 240. [Alias: timeout t]
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
Specifies a port number within the port rule to set. The valid range is between 0 and 65535.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
1 |
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. For more information, see about_CommonParameters.
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.
C:\PS>
Get-NlbClusterPortRule -Port 80 | Set-NlbClusterPortRule -NewStartPort 5
IPAddress State Start End Protocol Mode Affinity Timeout
--------- ----- ----- --- -------- ---- -------- -------
All Enabled 5 65535 Both Multiple Single 0
Description
-----------
This command changes the start port of the port rule 80 to 5.
C:\PS>
Get-NlbClusterPortRule -Port 80 | Set-NlbClusterPortRule -NewProtocol TCP
IPAddress State Start End Protocol Mode Affinity Timeout
--------- ----- ----- --- -------- ---- -------- -------
All Enabled 5 65535 Tcp Multiple Single 0
Description
-----------
This command changes the protocol of the port rule 80 to TCP.
C:\PS>
Get-NlbClusterPortRule 80 | Set-NlbClusterPortRule -NewMode Single
IPAddress State Start End Protocol Mode Affinity Timeout
--------- ----- ----- --- -------- ---- -------- -------
All Enabled 5 65535 Tcp Single 0
Description
-----------
This command changes the port rule mode to Single.
Add-NlbClusterPortRule
Disable-NlbClusterPortRule
Enable-NlbClusterPortRule
Get-NlbClusterPortRule
Remove-NlbClusterPortRule