Skip to content

Instantly share code, notes, and snippets.

@SvenAelterman
Created June 30, 2021 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SvenAelterman/104ce1f8934814c2e4882ab40b40f1ed to your computer and use it in GitHub Desktop.
Save SvenAelterman/104ce1f8934814c2e4882ab40b40f1ed to your computer and use it in GitHub Desktop.
Sets the cluster probe port for Windows Server Failover Cluster (WSFC) in Azure using a load balancer (traditional VNN, not needed for DNN). This is an enhancement to the script at https://docs.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-listener-powershell-configure#configure-the-listener
Import-Module FailoverClusters
[int]$ClusterProbePort = 58888 # The probe port from the WSFCEndPointprobe in the Azure portal. This port must be different from the probe port for the availability group listener probe port.
# Retrieve info from the cluster
$ClusterNetworkName = (Get-ClusterNetwork).Name
$IPResource = (Get-ClusterResource | Where {($_.OwnerGroup -eq "Cluster Group" -And $_.ResourceType -eq "IP Address")})
$IPResourceName = $IPResource.Name
$ClusterCoreIP = ($IPResource | Get-ClusterParameter | Where { $_.Name -eq "Address" }).Value
Get-ClusterResource $IPResourceName | Set-ClusterParameter -Multiple @{"Address"="$ClusterCoreIP";"ProbePort"=$ClusterProbePort;"SubnetMask"="255.255.255.255";"Network"="$ClusterNetworkName";"EnableDhcp"=0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment