I recently implemented a two host NLB cluster for IIS using only powershell. I thought I would share the process to achieve this.
The first step is to install the NLB features on your two web servers.This can be achieved by using the ServerManager module in powershell.
Import-Module ServerManager
Add-WindowsFeature NLB, RSAT-NLB
Import-Module NetworkLoadBalancingClusters
Once the NLB features are installed, the cluster can be created on one of the two node. I assume that you already have created all the network required for this to function.
New-NlbCluster -InterfaceName “Server Network” -ClusterName NLBArray -Hostname FIM-Node1 -ClusterPrimaryIP 10.0.1.100
The single node cluster called “NLBArray” is now created on FIM-Node1 with a cluster IP of 10.0.1.100. Next I removed all the default port rules.
Get-NlbClusterPortRule | Remove-NlbClusterPortRule -Force
Now we need to add the port rules for the various services that we will be hosting on this NLB cluster. This will depend on the various services that you intend to host. By default you should include port 80 and 443. For FIM you can include your default FIM service ports 5725 and 5726.
Get-NlbCluster | Add-NlbClusterPortRule -StartPort 80 -EndPort 80 -Protocol TCP -Affinity Single -InterfaceName “Server Network”
Get-NlbCluster | Add-NlbClusterPortRule -StartPort 443 -EndPort 443 -Protocol TCP -Affinity Single -InterfaceName “Server Network”
Get-NlbCluster | Add-NlbClusterPortRule -StartPort 5725 -EndPort 5725 -Protocol TCP -Affinity Single -InterfaceName “Server Network”
Get-NlbCluster | Add-NlbClusterPortRule -StartPort 5726 -EndPort 5726 -Protocol Both -Affinity Single -InterfaceName “Server Network”
Finally I added the second node to the current cluster and then wait for the cluster to converge.
Get-NlbCluster | Add-NlbClusterNode -NewNodeName FIM-Node2 -NewNodeInterface “Server Network”
All done!