Checking license activation

I’m building some virtual machines for my demo’s at the upcoming PowerShell summit.  To make the demo’s, and setup, more interesting(?) I decided to use some Server Core instances.

The usual setup activities become a bit more interesting with Server Core – particular Windows activation. 

Windows 2012 R2 will activate itself if the new machine has an Internet connection when it is created. With the GUI version of Windows you can check that Windows is activated using the System applet in Control Panel.

If you’re using Server Core you can use WMI to test activation:

Get-CimInstance -ClassName SoftwareLicensingProduct |
where PartialProductKey |
select Name, ApplicationId, LicenseStatus |
Format-List *

Use the SoftwareLicensingProduct WMI class and filter for PartialProductkey  – that means a product key has been entered. You can then select the name of the product the ApplicationId and the LicenseStatus:

Name          : Windows(R), ServerStandard edition
ApplicationId : 55c92734-d682-4d71-983e-d6ec3f16059f
LicenseStatus : 1

A License status of 1 indicates that its licensed – i.e. activated

More on using WMI to test and set activation in chapter 13 of PowerShell and WMI – www.manning.com/siddaway2

About these ads
This entry was posted in PowerShell and WMI, PowerShell V3, PowerShell v4, Windows Server 2012, Windows Server 2012 R2. Bookmark the permalink.

2 Responses to Checking license activation

  1. gbrayut says:

    I had to do a lot of activation and checking using Windows Server 2008 R2. I ended up using the Get-ActivationStatus cmdlet from http://social.technet.microsoft.com/wiki/contents/articles/5675.determine-windows-activation-status-with-powershell.aspx

    #Check for activation on remote systems
    Get-ADComputer -filter ‘samAccountName -like “vmgb*”‘ | Get-ActivationStatus

    #Update key and activate (may stall out if executed remotely, so use ctrl+c to cancel or run a background job)
    slmgr -ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX -ato

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s