Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
If you still have Windows 7 or Windows Server 2008 in your environment, you are probably painfully aware of the Extended Security Update (ESU) changes Microsoft introduced in January. Darrin VandenBos did a great job explaining the changes and how to use ZENworks to deploy updates in his article. In this article I’ll present an easy way to quickly determine which devices in your zone have properly installed and licensed ESU MAK keys. This can then be used for reporting purposes as well as a system requirement in your custom bundles to target only those devices with a valid ESU entitlement from Microsoft.
The first step in the process is to determine if a machine has a properly installed and licensed ESU MAK key. To do this you can create a bundle that runs the powershell script (esucheck.ps1) in the zip file attached to this article. By default it checks to see if a Windows 7 machine is licensed for Year 1 ESUs. It has commented lines for checking for Windows Server 2008 Year 1-3 and Windows 7 years 2 and 3 as well that you can uncomment in January next year to make sure it's now checking for year 2.
The easiest way to create a bundle that runs this is to simply import the exported bundle definition (Bundle_Export.zip) that is part of the zip file attached to this article.When you import it, it will create a Bundle in the folder you specify called Check Win7 ESU Key. To import the bundle
You can then customize the script action the way you want by going to the bundle properties, Actions > Launch tab and clicking on Run Script, which will display the script as shown below:
Some key things you may want to change include
Change Description |
What it does |
esuoutput |
This variable determines where the output of the slmgr.vbs command is output for parsing. The default path is c:\temp. |
adfRegPath |
This is the location in the registry where you want to store the value that will tell ZENworks whether there is a valid ESU license. |
CSCRIPT command |
By default this script checks to see if there is a valid Windows 7 Year 1 ESU license. If you want to check for a different year or for a Windows Server 2008 flavor then comment out the default cscript line and uncomment the one you want. |
You should now be able to assign the bundle to a test device that has a valid Windows 7 or Windows Server 2008 ESU key installed and execute the bundle. Make sure that the Win7ESULicenseStatus and Win7ESULicensePartialKey registry values end up being written to the adfRegPath location you specified.
Once you have the data in the registry, you can add it into the ZENworks database as Administrator Defined Fields (ADFs). In this article I add two of them : Windows ESU License Status and Windows ESU Partial License Key. This will allow you to then use either the built in reporting capabilities of ZENworks Control Center or ZENworks Reporting to generate reports about this data. To configure these ADFs and make sure that they are picked up on inventory do the following:
Note the Internal Name of the ADFs you create so you can use them in your ZRS report.
When you’ve completed these steps you can now wait for the inventory scan to execute or you can force a scan with the Inventory Wizard quicktask. After your devices scan you can then run reports. To do this from ZCC:
If you want more of a graphical view like the one above, you can use ZENworks Reporting to build a chart report that would should you the devices. To do this:
You can now save this chart. You could create a similar table view that has the details of the devices and then combine them into a Dashboard if desired.
In addition to using these attributes for reporting you can also use them in your system requirements. If you are using Custom Patches, you can add a System Requirement that checks for HKEY_LOCAL_MACHINE\Software\ZENguru\Win7ESULicenseStatus=Licensed (or whatever key you specified). This will cause your Custom Patches to only be flagged as Applicable if the device has an ESU MAK key. This will prevent the patches from attempting to transact on non-ESU enabled devices so that you don’t get unnecessary errors in the system.
Using the techniques described in this document you can quickly and easily identify which machines in your environment have a properly licensed ESU key so that you can deploy ESU patches to those devices. You can also see which devices may be at risk because they do not have a proper key. When combined with the techniques described in the ESU patching article you will have full reporting and patching capabilities through ZENworks.