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.

  • You are asking about the Edition and not about the Version, correct? – John aka hot2use Aug 28 '17 at 11:06
  • @hot2use Correct. I can get the Version from sqlservr.exe, but I haven't found a way to find the Edition without DB or Registry access and I don't have setup.exe on production servers and the summary with all the logs have been deleted. – Ramil Aug 28 '17 at 11:58
  • Thanks for pointing me to the link you provided, hot2use. Got my answer from @Bob Pusateri and seems it was my last straw. Getting the info from an errorlog is the most I can do, but it will suffice. I see already that a server I thought was Standard, is actually Express. – Ramil Aug 28 '17 at 13:03
  • By the way.. I wanted to put my solution here for all to see, but it's too long and the system won't let me :| Should anyone be interested in the solution, PM or something. – Ramil Aug 28 '17 at 13:56
-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).

| improve this answer | |
  • Unfortunetaly production servers are as bare as possible, mearning all kinds of residiual stuff has been removed for security purposes. – Ramil Aug 28 '17 at 11:50
-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

| improve this answer | |
  • Apparently OP does not have access to Registry ...I found plenty of ways to determine the Edition, PatchLevels, Service Packs and stuff from Registry and via SSMS, but unfortunetaly I have access to neither of them... – John aka hot2use Aug 28 '17 at 7:20
  • Yes I have read that and I have mentioned that in my answer it scans the registry, but I wanted him to try anyways. – Shanky Aug 28 '17 at 7:22
  • I am not sure who downvoted may be he lacks appreciation and knowledge, in the answer it is also mentioned that please see SQL Server installation summary.txt file which has information about all the SQL Server instances installed. ofcourse the latest one would have all the details – Shanky Aug 28 '17 at 10:54
  • @Shanky Thanks for the additional suggestions, but to futher complicate things, our production server have all unnecessary stuff removed for security purposes. Which means that the summary stuff and the setup have been removed. Which means I can't run the discovery tool. PS! While "getting SQL Server access" would be a seemingly easy choice, it isn't in our environment. Noone's going to give me permissions to thousands of hosts just so I could check if they have an SQL Server installed and if yes, which Edition. Unfortunetaly we don't have a complete list of the servers/instances either :P – Ramil Aug 28 '17 at 11:56
  • @Ramil so you want to say that even the installation logs have been removed as well ?. I was trying to say that if some one wants to get SQL Server inventory a simple read access would not harm but since I do not know much about the security so I will not comment much. I would still suggest you to ask for this, this will save both yours and clients time – Shanky Aug 28 '17 at 17:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.