Detecting Windows License Activation Status Using ConfigMgr DCM and OpsMgr

Written by Tao Yang

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

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.

5 comments on “Detecting Windows License Activation Status Using ConfigMgr DCM and OpsMgr

  1. Nice, Tao. DCM is fun.

  2. Pingback: Sertaç Topal » Configuration Manager Ocak 2015 Bülten

  3. Pingback: NeWay Technologies – Weekly Newsletter #129 – January 8th, 2014 | NeWay

  4. Pingback: NeWay Technologies – Weekly Newsletter #129 – January 9th, 2014 | NeWay

  5. 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
    Next

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

    Cheers,

Leave a Reply