PowerShell for Windows Admins

Apr 13 2014   5:50AM GMT

Checking license activation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

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

 

 

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: