Notifications

119 views

Symptoms

MSSQL discovered via "MSSql DB On Windows" pattern with empty edition.

Release

Currently supported releases.

Cause

  • Edition not available in namespace.
  • Edition not available via "sqlservr.exe -v" command.
  • No credentials available with rights to query target sql.

Resolution

Edition via namespace

Check that namespaces are available:

Get-WmiObject -namespace "root\Microsoft\SqlServer" -Query "SELECT Name FROM __NAMESPACE"

Find the namespaces which name CONTAINS ComputerManagement

Confirm if the edition is available by querying the namespace. For sql 2012 for example, the following can be run on PowerShell on the target server:

Get-WmiObject -namespace "root\Microsoft\SqlServer\ComputerManagement11" -Query "SELECT * FROM SqlServiceAdvancedProperty"

Namespaces per sql version:

2005ComputerManagement 
2008 ComputerManagement10 
2012 ComputerManagement11 
2014 ComputerManagement12 
2016 ComputerManagement13


Filter the results that match following conditions:

PropertyName "SKUNAME" 
ServiceName "MSSQL$" + instance_name

Solution:

Confirm that the correct namespace was used. If the edition is not available in the correct namespace, work with your mssql admin to add the version to the namespace.

If incorrect namespace was used, review pattern logs to determine why incorrect namespace was used.

Edition via sqlserv.exe

As a fallback if the edition is still empty, the "MSSql DB On Windows" pattern will attempt to collect the version via following command:

"\"" + $process.executablePath + "\" -v"

For example, would depend on install path:

C:\Program Files\Microsoft SQL Server\MSSQL12.INSTANCE\MSSQL\Binn\sqlserv.exe -v

Solution:

If the correct path was used, work with your mssql admin so that "sqlserv.exe -v" works as expected.

Edition via mssql query

As a final fallback, the pattern will attempt to collect the version via sql query "SELECT @@version;"

Solution:

Add credentials with rights to query target mssql server.

Finally

Check that the patter being used is the newest OOB version.

Additional Information

Related link:

Article Information

Last Updated:2019-05-21 11:56:19
Published:2019-04-12