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.
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.
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“
Step 2: Open the setup file to go for installation wizard.
Step 3: Click on “Upgrade Edition” and you will find the product key, see next step.
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.
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”
Step 2: Open the folder and go to the location as shown in the image and look for “DefaultSetup”
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.
SSRS Installation
TSG’s
- The Job Failed. Unable To Determine If The Owner (KTTsvc_ssrs19) Of Job
- Port Number For Analysis Services – Find Ports For SSAS? (kingfishertechtips.in)
- SMTP Server In SSRS/PBIRS |Subscribe To Email Problem/Issue (kingfishertechtips.in)
- SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
- Creating Tabular Project & Deploy Model To Analysis Service (kingfishertechtips.in)
- Deploy Tabular Project To Azure Analysis Service – SSDT Tool (kingfishertechtips.in)
- SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
- Could Not Load Folder Contents In Portal URLs – SSRSPBIRS (kingfishertechtips.in)
- SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
- SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
- Capture Fiddler Trace for Debugging the Network Traffic (kingfishertechtips.in)
- On-Premises Gateway: Configure/Map SQL DB To Power Bi (kingfishertechtips.in)
- Fixed Column/Row Header Make Visible In Any Report (kingfishertechtips.in)
- Self-Signed Certificate: Configure SSRS/PBIRS With SSL (kingfishertechtips.in)
- Create Local User Account/Local Admin User In Windows 10/11 (kingfishertechtips.in)
- Login With AAD/Domain/Microsoft Account To Azure VM’s/RDP (kingfishertechtips.in)