2

Anyone have an idea how to get Microsoft SQL Server Edition (Express, Standard, Enterprise, Developer) without access to the database or registry?

I got the version like this:

$SQLFP = (Get-WmiObject -Class Win32_Service -ErrorAction Stop | Where-Object { $PSItem.Name -eq 'MSSQLSERVER' } | Select-Object -ExpandProperty PathName).Split('"')[1]
$SQLVer = ([System.Diagnostics.FileVersionInfo]::GetVersionInfo($SQLFP).ProductVersion).Split('.')[0]

Switch ($SQLVer) {
    "10" { "Version: Microsoft SQL Server 2008/R2" }
    "11" { "Version: Microsoft SQL Server 2012" }
    "12" { "Version: Microsoft SQL Server 2014" }
    "13" { "Version: Microsoft SQL Server 2016" }
    "14" { "Version: Microsoft SQL Server 2017" }
    Default { "Unsupported version." }
}

I found plenty of ways to determine the Edition, Patch Levels, Service Packs and stuff from Registry and via SSMS, but unfortunately I have access to neither of them. I do have permission to access the file system.

Paul White
  • 94,921
  • 30
  • 437
  • 687
Ramil
  • 37
  • 5

2 Answers2

-1

If you have access to file system, one way of getting information could be to check available folders under %PROGRAMFILES%\Microsoft SQL Server\xyz

where xyz translates to:

 80 = SQL Server 2000    =  8.00.xxxx
 90 = SQL Server 2005    =  9.00.xxxx
100 = SQL Server 2008    = 10.00.xxxx
105 = SQL Server 2008 R2 = 10.50.xxxx
110 = SQL Server 2012    = 11.00.xxxx
120 = SQL Server 2014    = 12.00.xxxx
130 = SQL Server 2016    = 13.00.xxxx

Further you can analyze the installation summary file located at %PROGRAMFILES%\Microsoft SQL Server\xyz\Setup Bootstrap\Log\Summary.txt which will give you package properties that contains information about Installation edition (Enterprise).

Vijay
  • 121
  • 3
-1

Do you have permission to run SQL Server discovery report. If you are windows admin you would have. This does not requires access to SQL Server, but this discovery report does accesses registry and brings out the information. This will give you both version and edition

For express you can also see file system which has file name like MSSQLn.SQLEXPRESS. Some more details in This SO link.

The location would be %PROGRAMFILES%\Microsoft SQL Server\. You would see like

enter image description here

80 = SQL Server 2000
90 = SQL Server 2005
100 = SQL Server 2008
110= SQL Server 2012
120= SQL Server 2014
130= SQL Server 2016

You also have SQL Server installation files located at %programfiles%\ Microsoft SQL Server\130\Setup Bootstrap\Log\. Check summary.txt file.

PS: This whole process is waste of time I would suggest get SQL Server access and make your life easier

Shanky
  • 19,148
  • 4
  • 37
  • 58