Windows Server 2008 and 2012 Network Load Balancing (NLB) Cluster using PowerShell

Home > Blogs > Windows Server > Windows Server 2008 and 2012 Network Load Balancing (NLB) Cluster using PowerShell

Windows Server 2008 and 2012 Network Load Balancing (NLB) Cluster using PowerShell

Like This Blog 4 Rick Trader
Added by July 3, 2013

One of the major improvements to NLB in Windows Server 2008R2 and Windows Server 2012 is the addition of a NetworkLoadBalancingClusters module to PowerShell.  When the NLB-RSAT are installed 35 new NLB related CMDlets are available.  In this blog we will be exploring some of the new CMDlets.

Installing Network Load Balancing Cluster.

To install the NLB feature and NLB-RSAT tool set type the following, Install-windowsfeature NLB,RSAT-NLB


Note: In Windows Server 2008R2 the CMDlet to install a windows feature is add-windowsfeature.

To view a complete list of NLB CMDlets type the following CMDlet, Get-command -module NetworkLoadBalancingClusters

002-Get-command module-NetworkLoadBalancingClusters-NLB-using-PowerShell

Note: On Windows Server 2008R2 the NLB Manifest must be imported first before viewing a list of CMDlets.  To import the Manifest type Import-Module NetworkLoadBalancingClusters.

To get help on and individual CMDlet use the built in help system of PowerShell, ie Get-help New-NLBCluster   Use the -Full, -Detailed, -Online or -Examples for more information.



A network load balancing cluster needs to be configured using USSHQSVR1 and USSHQSVR2.  The cluster name will be USSHQNLB.

Creating the NLB Cluster, use the following steps to configure:

  1. To create a new NLB cluster the New-NLBCluster CMDlet will be used.  On Server1 launch PowerShell to configure NLB on the first server, type the following CMDlet,  New-NLBCluster -Interface “Ethernet” -OperationMode Multicast -ClusterPrimaryIP -ClusterName USSHQNLB


  • Interface – is the user friendly name displayed for the desired interface in the Network and Sharing Center.  In my example my interface name was Ethernet.  The default name may be Local Area Connection.
  • OperationMode
    • Unicast – All cluster hosts use the same unicast MAC address.  Suitable for NLB Clusters with a single network card.
    • Multicast – Each cluster host keeps it original MAC address, but is assigned an additional NLB Cluster MAC address.   Suitable for NLB Clusters with multiple network card.
    • Igmpmulticast – Special mode to prevent the switch from being flooded.
    • ClusterPrimaryIP – Configures the primary IP address of the NLB Cluster.
    • ClusterName – [Optional] Specifies the name of the NLB Cluster.

2. Port Rules are used to control how traffic is routed to the NLB Cluster nodes depending on port.  If desired after creating the NLB cluster you may want to modify the NLB Port Rules.  PowerShell provides a set of CMDlets to manage the NLB Port Rules.  This should be accomplished prior to adding additional nodes to the NLB environment.  The primary CMDlet for accomplishing this task is Set-NLBClusterPortRule.

  • Set-NLBClusterPortRule
    • NewStartPort – Specifies the new start port for the cluster port rule. The acceptable range is between 0 and 65535.
    • NewEndPort – Specifies the new end port for the cluster port rule. The acceptable range is between 0 and 65535.
    • NewAffinity – Specifies the new affinity for the cluster port rule. There are three possible values for port rule affinity: none, single, and network.
    • Add- NLBClusterPortRule.
      • Used to add a new port rule.
    • Disable- NLBClusterPortRule.
      • Used to disable a new port rule.
    • Enable- NLBClusterPortRule.
      • Used to enable a new port rule.
    • Remove- NLBClusterPortRule.
      • Used to remove a new port rule.

Adding Nodes to the NLB Cluster.

1. The additional node can be configured either locally or remotely.  In this demo I will be configuring it remotely. Using PowerShell type Invoke-Command -Computername  USSHQSVR2 -Command {Install-Windowsfeature NLB,RSAT-NLB}  to install the NLB feature on USSHQSVR2.


2. To add the USSHQSVR2 to the NLB Cluster type the following, Add-NlbClusterNode -InterfaceName “Ethernet” -NewNodeName “USSHQSVR2” -NewNodeInterface “Ethernet”


3. A 2 node NLB Cluster is now configured, to view the NLB Cluster type Get-NLBClusterNode | Format-List * (See figure 7).   To verify the NLB Cluster IIS could be installed, using the default website make an obvious change to the landing page on one server.  Create and entry in DNS for the NLB Cluster IP Address and connect to the Website for a client.  Disconnect or disable the NIC on the sever you connected to and refresh the screen.  You should see the landing page on the other server.


Your Network Load Balancing Cluster is now all configured and tested.  Until next time Ride Safe!

Rick Trader
Windows Server Instructor – Interface Technical Training
Phoenix, AZ

Videos You May Like

A Simple Introduction to Cisco CML2

0 3774 0

Mark Jacob, Cisco Instructor, presents an introduction to Cisco Modeling Labs 2.0 or CML2.0, an upgrade to Cisco’s VIRL Personal Edition. Mark demonstrates Terminal Emulator access to console, as well as console access from within the CML2.0 product. Hello, I’m Mark Jacob, a Cisco Instructor and Network Instructor at Interface Technical Training. I’ve been using … Continue reading A Simple Introduction to Cisco CML2

How to use the PowerShell Script Analyzer to Clean Up Your Code

0 1235 2

In this video, PowerShell instructor Jason Yoder demonstrates how you can use the PowerShell Script Analyzer to help you format your code to best-practices. For instructor-led PowerShell training classes, see our course schedule: Microsoft Windows PowerShell Training Download the PowerShell Analyzer scripts used in this video. <# ╔══════════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ PowerShell Script Analyzer ║ … Continue reading How to use the PowerShell Script Analyzer to Clean Up Your Code

OSPF Adjacency Troubleshooting Solution – Getting Close to the OSPF adj

0 249 1

In this video, Cisco CCNA & CCNP instructor Mark Jacob shows how to troubleshoot OSPF Adjacency issues by showing the distance between routers with the show ip ospf neighbor command.

Write a Comment

See what people are saying...

    Share your thoughts...

    Please fill out the comment form below to post a reply.