Detecting Windows License Activation Status Using ConfigMgr DCM and OpsMgr

1 minute read

Hello and Happy New year. You are reading my first post in 2015! This is going to a quick post, something I did this week.

Recently, during a ConfigMgr 2012 RAP (Risk and Health Assessment Program) engagement with Microsoft, it has been identified that a small number of ConfigMgr Windows client computers do not have their Windows License activated. The recommendation from the Microsoft ConfigMgr PFE who’s running the RAP was to create a Compliance (DCM) baseline to detect whether the Windows license is activated on client computers.

To respond to the recommendation from Microsoft, I quickly created a DCM baseline with 1 Configuration Item (CI). The CI uses a simple PowerShell script to detect the Windows license status.

image

$InstalledLicense = Get-WmiObject -Query "Select * from SoftwareLicensingProduct Where PartialProductKey IS NOT NULL AND ApplicationID = '55c92734-d682-4d71-983e-d6ec3f16059f'"
Switch ($InstalledLicense.LicenseStatus)
{
  0 {"Unlicensed"}
  1 {"Licensed"}
  2 {"Out-of-Box Grace Period"}
  3 {"Out-of-Tolerance Grace Period"}
  4 {"Non-Genuine Grace Period"}
  5 {"Notification"}
  6 {"ExtendedGrace"}
}

I configured the CI to only support computers running Windows 7 / Server 2008 R2 and above (as per the minimum supported OS for the SoftwareLicensingProduct WMI class documented on MSDN: http://msdn.microsoft.com/en-us/library/cc534596(v=vs.85).aspx):

image

The CI is configured with 1 compliance rule:

image

Next, I created a Compliance baseline and assigned this CI to it. I then deployed the baseline to an appropriate collection. after few hours, the clients have started receiving the baseline and completed the first evaluation:

SNAGHTMLfeb9db8

Additionally, since I have implemented and configured the latest ConfigMgr 2012 Client MP (Version 1.2.0.0), this DCM baseline assignments on SCOM managed computers are also discovered in SCOM, any non-compliant status would be alerted in SCOM as well.

image

That’s all for today. It is just another example on how to use ConfigMgr DCM, OpsMgr and ConfigMgr 2012 Client MP to quickly implement a monitoring requirement.

Leave a comment