Automatic Bind Rule for MSSQL servers

Started by Darren Leggett, September 25, 2025, 03:55:02 PM

Previous topic - Next topic

Darren Leggett

Hi

I've got a number of Windows Servers running a variety of different versions of MSSQL server.  I was wondering if anyone has come up with an Automatic Bind rule that can be used to bind them to a container.


Benjamin Dill

Im using this metric (deployed by a template attached to all Windows systems):
ExternalMetric = MSSQL.InstalledInstancesCount:powershell -NonInteractive -NoProfile -Command "& { (Get-ItemProperty \"HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\").InstalledInstances.Count }"

Then you can use something like this in automatic bind/auto apply:
value = $node.readAgentParameter("MSSQL.InstalledInstancesCount");
return (value != NULL && typeof(value) == "int32" && value > 0);

Darren Leggett

Thanks, that's was exactly what I needed.