Server 2012 - Extended Support

With Server 2012 going End of Life and requiring extended support on October 10th. I’m being asked ot generate a report from Rapid7 showing what systems have Extended support applied. I was thinking of doing this using a compliance policy and using a WMI query that would check the license status. I have the query working in powershell but am having trouble getting it working in the compliance policy

Powershell
(Get-WmiObject -Query (‘SELECT LicenseStatus FROM SoftwareLicensingProduct where PartialProductKey = “{0}”’ -f “GMXTD”)).LicenseStatus

Returns a value of 1 if the system is licensed

For the compliance policy I have the check built as a WMI test

Type - Wmi Test
Test Title - Extended support license is installed
Existence - All Exist
Check - All
Expected Result - Pass

Definition ID - def-5197

WMI Namespace - root\cimv2
Operator - equals
WQL Query - SELECT LicenseStatus FROM SoftwareLicensingProduct where PartialProductKey = “{0}”’ -f “GMXTD”
Operator - equals

Expected Result
Licensestatus - 1
Operator - equals

image

I checked in on Tenable and they actually have a check that looks for if a system has extended support in place

https://www.tenable.com/plugins/nessus/182965

Microsoft Windows Server 2012 / 2012 R2 ESU Status Check

Does Rapid7 have any plans to develop some sort of a check for that? It would be nice to have a way to validate that Extended Support licenses are getting implemented correctly.