Powershell – Add Server to NLB and Make its Default State to be Stopped

Add a member to the NLB Cluster and make its default state to be stopped

Background to this is: I was automating a build of a server. I have a csv file that I read that has details of all the servers, ipaddresses and environments.

CSV something like this

This means I can use the same script for Production or Test environments  and it will join the server to the correct NLB Farm

In my case I wanted to join the server to the cluster , but not necessarily be available to be used by the cluster.
The annoying thing about the Add-NlbClusterNode is that you cannot set the default state, or its initial state (i.e stopped on restart of server and stopped as you join the NLB). So the below is for a web server NLB and I stop the Website (Default Website) first so that in the rare case a user might get to my server as I join it to the NLB, they will get a 404, decide to refresh the webpage and by that time the server will be stopped and one of the other NLB servers will take over.

After setting the new member to be Stopped, I then start the website. Why? because in my case we want QA people to directly access the server and check it before putting it back into the NLB

 

 

 

 

Leave a comment

Your email address will not be published. Required fields are marked *