License Key For SQL Server Reporting Services (PAYG)

License Key for SQL Server Reporting Services: I often get asked by customers, colleagues, and friends in the Azure community, “Where do I find the product key for SQL Server Reporting Services if I’m using PAYG licensing from Azure?”

Honestly, it’s a great question because the Azure portal doesn’t show the product key when deploying, and there’s no command in PowerShell or AZ CLI to get it. But don’t worry, finding the key is actually pretty simple and works outside of Azure too. You can use option 1 below on any SQL server to find the product key.

Assuming you know how to download and install the latest version of SSRS, here’s a handy link to the download page if you need it:

Now, let’s dive into the 3 methods you can use to find the product key on an Azure IaaS SQL VM deployed with a marketplace image on the PAYG licensing model. Anyone of this should work

License Key for SQL Server Reporting Services

Method 1: PowerShell

There is best command line tools to install which will help us to get the SQL Server key from any machine but first we have to install some command line tools, please follow the below steps.

Step 1: Download the script from the below code section and replace the values accordingly as per your SQL Version. Check the original doc!

## function to retrieve the license key of a SQL Server.
##regPath for SQL2008/2008 R2 = "SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\Setup"
##regPath for SQL2012 = "SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\Setup"
##regPath for SQL2014 = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\Setup"
##regPath for SQL2016 = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVER\Setup"
##regPath for SQL2017 = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\Setup"
##regPath for SQL2019 = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15.MSSQLSERVER\Setup"
##regPath for SQL2022 = "SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\Setup"
##Need to change RegPath value according to your SQL server version 


function Get-SQLserverKey {
## function to retrieve the license key of a SQL Server.

param ($targets = ".")
$hklm = 2147483650
$regPath = "ENTER AS PER SQL SERVER VERSION"
$regValue1 = "DigitalProductId"
$regValue2 = "PatchLevel"
$regValue3 = "Edition"
Foreach ($target in $targets) {
$productKey = $null
$win32os = $null
$wmi = [WMIClass]"\\$target\root\default:stdRegProv"
$data = $wmi.GetBinaryValue($hklm,$regPath,$regValue1)
[string]$SQLver = $wmi.GetstringValue($hklm,$regPath,$regValue2).svalue
[string]$SQLedition = $wmi.GetstringValue($hklm,$regPath,$regValue3).svalue
$binArray = ($data.uValue)[0..16]
$charsArray = "B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9"
## decrypt base24 encoded binary data
For ($i = 24; $i -ge 0; $i--) {
$k = 0
For ($j = 14; $j -ge 0; $j--) {
$k = $k * 256 -bxor $binArray[$j]
$binArray[$j] = [math]::truncate($k / 24)
$k = $k % 24
}
$productKey = $charsArray[$k] + $productKey
If (($i % 5 -eq 0) -and ($i -ne 0)) {
$productKey = "-" + $productKey
}
}
$win32os = Get-WmiObject Win32_OperatingSystem -computer $target
$obj = New-Object Object
$obj | Add-Member Noteproperty Computer -value $target
$obj | Add-Member Noteproperty OSCaption -value $win32os.Caption
$obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture
$obj | Add-Member Noteproperty SQLver -value $SQLver
$obj | Add-Member Noteproperty SQLedition -value $SQLedition
$obj | Add-Member Noteproperty ProductKey -value $productkey
$obj
}
} Get-SQLserverKey

Step 2: Once done change the value accordingly, in my case you can see that I am using SQL 2022 named instance(SQLA\DB) so I will replace the SQL 2022 reg path and run this.

License Key for SQL Server Reporting Services

Step 3: Now you have to scroll completely at the bottom of the output, you will also see multiple error, you can ignore and scroll down to get the key. In my case it is developer so I am seeing BBBBB-BBBBB-BBBBB-BBBBB-BBBBB-BBBBB, if you have valid license then you will get it.

sql license

Method 2: SQL Server Setup Wizard

Step 1: Go to the local C drive path if you are using marketplace azure VM to get the SQL setup. Open the folder “SQLServerFull

License Key for SQL Server Reporting Services

Step 2: Open the setup file to go for installation wizard.

License Key for SQL Server Reporting Services

Step 3: Click on “Upgrade Edition” and you will find the product key, see next step.

License Key for SQL Server Reporting Services

Step 4: Now, here you will see the license details as shown in the below image, if is on prem then you will find here, most cases you will see blank if you are using Pay-As-You-Go Option, for this check the 3rd method.

License Key for SQL Server Reporting Services

Method 3: ISO File “.ini” File

Step 1: Go to the local C drive path if you are using marketplace azure VM to get the SQL setup. Open the folder “SQLServerFull”

License Key for SQL Server Reporting Services

Step 2: Open the folder and  go to the location as shown in the image and look for “DefaultSetup”

License Key for SQL Server Reporting Services

STEP 3: Once you open the file with notepad and you will get this file, under that you will see PID and this is your SSRS product key which you can use.

License Key for SQL Server Reporting Services

SSRS Installation

License Key for SQL Server Reporting Services

TSG’s

  1. The Job Failed. Unable To Determine If The Owner (KTTsvc_ssrs19) Of Job
  2. Port Number For Analysis Services – Find Ports For SSAS? (kingfishertechtips.in)
  3. SMTP Server In SSRS/PBIRS |Subscribe To Email Problem/Issue (kingfishertechtips.in)
  4. SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
  5. Creating Tabular Project & Deploy Model To Analysis Service (kingfishertechtips.in)
  6. Deploy Tabular Project To Azure Analysis Service – SSDT Tool (kingfishertechtips.in)
  7. SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
  8. Could Not Load Folder Contents In Portal URLs – SSRSPBIRS (kingfishertechtips.in)
  9. SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
  10. SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
  11. Capture Fiddler Trace for Debugging the Network Traffic (kingfishertechtips.in)
  12. On-Premises Gateway: Configure/Map SQL DB To Power Bi (kingfishertechtips.in)
  13. Fixed Column/Row Header Make Visible In Any Report (kingfishertechtips.in)
  14. Self-Signed Certificate: Configure SSRS/PBIRS With SSL (kingfishertechtips.in)
  15. Create Local User Account/Local Admin User In Windows 10/11 (kingfishertechtips.in)
  16. Login With AAD/Domain/Microsoft Account To Azure VM’s/RDP (kingfishertechtips.in)
Vickey Rajpoot
Vickey Rajpoot

Hello there! I'm dedicated Microsoft Data & AI Engineer at LTIMindtree, where I thrive technology into actionable insights. Dive into my world by visiting my YouTube channel & Webiste, "Kingfisher Tech Tips".

Articles: 112

Leave a Reply

Your email address will not be published. Required fields are marked *