PowerShell: Check Windows License Status

In PowerShell, you can directly access the raw licensing data like this:

PS> Get-WmiObject SoftwareLicensingService

You can also check the license status of your copy of Windows:

PS> Get-WmiObject SoftwareLicensingProduct | Select-Object -Property Description, LicenseStatus | Out-GridView

And you can find out which Windows SKU you are actually using:

PS> Get-WmiObject SoftwareLicensingProduct | Where-Object { $_.LicenseStatus -eq 1 } | Select-Object -ExpandProperty Description
Windows Operating System - Windows(R) 7, RETAIL channel

To investigate all the other logic found in slmgr, have a look at the VBScript source code:

PS> notepad (Get-Command slmgr).Path

Leave a Reply

Your email address will not be published.