Detecting Windows License Activation Status Using ConfigMgr DCM and OpsMgr

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.


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:


The CI is configured with 1 compliance rule:


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:


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


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.


  1. Nice post! Almost made my day! 🙂
    If powershell scripts execution policy is restricted, you might need this VBScript for the work-around too:

    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
    Set colItems = objWMIService.ExecQuery( _
    “Select * from SoftwareLicensingProduct Where PartialProductKey IS NOT NULL AND ApplicationID = ’55c92734-d682-4d71-983e-d6ec3f16059f'”,,48)
    For Each objItem in colItems
    select case objItem.LicenseStatus
    case “0”
    Wscript.Echo “Unlicensed”
    case “1”
    Wscript.Echo “Licensed”
    case “2”
    Wscript.Echo “Out-of-Box Grace Period”
    case “3”
    Wscript.Echo “Out-of-Tolerance Grace Period”
    case “4”
    Wscript.Echo “Non-Genuine Grace Period”
    case “5”
    Wscript.Echo “Notification”
    case “6”
    Wscript.Echo “ExtendedGrace”
    end select

    Hope if someone bumps in the powershell “limitations”, this could help out!


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: