Failover Cluster Lease Timeout Availability Group

I need to change the LEASE TIMEOUT on an Availability Group on hundreds of SQL Servers. I have seen the following command for changing the HEALTH_CHECK_TIMEOUT -

ALTER AVAILABILITY GROUP AG_Name SET (HEALTH_CHECK_TIMEOUT = 600000) ;

But there doesn't seem to be any TSQL for changing the LEASE TIMEOUT -

Am I overlooking the obvious? I would prefer to avoid having to manually change the LEASE TIMEOUT value in the Failover Cluster Manager on all of these servers.

Thanks

PowerShell is your best best:

Get-Cluster -Name "Cluster1" | Get-ClusterResource | Where-Object { $_.ResourceType -eq "SQL Server Availability Group" } | Set-ClusterParameter -Name "LeaseTimeout" -Value 600000

There are ways to enumerate a list of cluster names but I don't know them offhand. In any case you can generate that list and then pipe it to the Get-Cluster cmdlet and it will process them all.

You may have to install PowerShell remoting on the cluster nodes in order for this to work properly, I haven't tested it on more than 2 clusters myself.

1 Like

Ahhh - thank you.... I will give this a try...

Regards

Works perfectly - again, thanks!

I am getting below error, could you please suggest.

Get-ClusterResource: The input object cannot be bound to any parameters for the command either because the command does not
take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.