Skip to main content

Snow Inventory Agent Script - Microsoft SQL Server editions and versions 2

Here you can find the release notes for Snow Inventory Agent Script - Microsoft SQL Server editions and versions 2.


2.0 latest

Release date: 2024-02-08

Compatible Versions

Snow Inventory Agent for WindowsMicrosoft PowerShell
Version 5 or laterVersion 3 and later

Information

The scan-Microsoft-SQLServer.ps1 script enhances the default scanning capabilities of the Snow Inventory Agent and allows the Software Recognition Service a more precise identification of installed Microsoft SQL Server editions.

The script must be executed as part of the Snow Inventory Agent for Windows, according to the topic Running PowerShell scripts as part of the scanning process on Snow Docs. Otherwise the results will not be included in the snowpack.

In the case that you want to run a manual scan, this script must be executed with appropriate permissions, so execute it using only sc.exe control SnowInventoryAgent5 128, as described in the Windows Agent - Command line topic on Snow Docs.

For debugging purposes, the script can be executed manually and supports common parameters, so you will receive detailed logs using the command scan-microsoft-SQLServer.ps1 -Debug -InformationAction 'Continue'.

Function

The script utilizes the following PowerShell cmdlets

  • Get-Item and Get-ItemProperties to search the registry.
  • Get-Content to scan the ERRORLOG file within the SQL Server directory, which contains the accurate version and edition information.
  • Get-Service to query the service details.
  • Get-ItemProperties to get details from the search the sql server executable.

The script searches the following registry paths

  • HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server
  • HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  • HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
  • HKLM:\SYSTEM\CurrentControlSet\Services

With the found details, the script creates different software rows in the scan result.

Supported MS SQL Server Versions and what they are converted to:

SQL Server versionSoftware name
7.*Microsoft SQL Server 7.0
8.*Microsoft SQL Server 2000
9.*Microsoft SQL Server 2005
10.*Microsoft SQL Server 2008
10.*Microsoft SQL Server 2008 R2
11.*Microsoft SQL Server 2012
12.*Microsoft SQL Server 2014
13.*Microsoft SQL Server 2016
14.*Microsoft SQL Server 2017
15.*Microsoft SQL Server 2019
16.*Microsoft SQL Server 2022

It returns the script manifest using the name Scan-MicrosoftSQLServer.

MediumIntegrity

This script does need medium integrity to search the registry and access the SQL Server errorlogs.

Troubleshooting

Custom encryption might need to be applied to this script when running on Snow Inventory Agent for Windows prior to version 7, as it will not be executed in medium integrity.

NEW

  • Snow Inventory Agent for Windows 7 support.
  • The script is now signed by Snow Software AB.

ENHANCEMENT

  • adopted Snow Software Template and helper functions

DEPRECATED

  • There will be no encrypted snow-ps1 version of this script provided by Snow Software.

Flexera does not own the third party trademarks, software, products, or tools (collectively, the "Third Party Products") referenced herein. Third Party Product updates, including user interface updates, may not be reflected in this content.