Hi,
I have a powershell script to list the SQL Server instance port that is fully functional on the server itself but that return nothing when executed by SAM. The server is monitored through a SolarWinds agent.
The script is:
$path = 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\*\MSSQLServer\SuperSocketNetLib\Tcp\IPAll'
$name = "TcpPort"
[array]$value = (Get-ItemProperty -Path $path -name $name)
$v = $value.TcpPort
Write-Host "Message: VALUE: $v"
write-host "Statistic: $($v.count)"
the output on the server is:
Message: VALUE: 54046 57782 57650 53162 53932 55822 60945 50526
Statistic: 8
The output from SAM is:
Message.Statistic: VALUE:
Statistic.Statistic: 0