IIS 7 and Above
Stop-NlbClusterNode perform stop all nodes
Last post May 30, 2018 05:55 AM by deepakpanchal10
May 29, 2018 10:02 AM|davidmichaeli|LINK
I have a issue with my script (powershell) that is monitored my nlb cluster that have only 2 nodes.
my script is checks the state of the iis (for each a node), and check the state of the node, if the iis is down, so i perform stop-NlbClusterNode on the certain node, but it perform stop all nodes..
i try few options:
Stop-NlbClusterNode -InputObject (Get-NlbClusterNode -NodeName "node1")
Stop-NlbClusterNode -HostName "node1" -Drain -Timout 10
but always all nodes are stopped.
May 30, 2018 05:55 AM|deepakpanchal10|LINK
I can see that you did not posted the full script.
So it is possible that you try to stop all nodes in it.
You can try to refer the example below and try to put your code in else part of both if conditions to stop the specific node as per condition.
$node1 = "Server1"
$node2 = "Server2"
#get NLB status on NLB Nodes
$Node1status = Get-WmiObject -Class MicrosoftNLB_Node -computername $node1 -namespace root\MicrosoftNLB | Select-Object __Server, statuscode
$Node2status = Get-WmiObject -Class MicrosoftNLB_Node -computername $node2 -namespace root\MicrosoftNLB | Select-Object __Server, statuscode
IF ($node1.statuscode -eq "1008" -or $node1.statuscode -eq "1007")
write-host "NLB Status of $node1 is: Converged"
write-host "NLB Status of $node1 is: Error"
IF ($node2.statuscode -eq "1008" -or $node2.statuscode -eq "1007")
write-host "NLB Status of $node2 is: Converged"
write-host "NLB Status of $node2 is: Error"
Check NLB status on nodes