Taking a look at the Software Metering workflow in System Center 2012 Configuration Manager

~ Pramod Sathyanarayana Kashyap

GearsHello everyone, my name is Pramod Sathyanarayana Kashyap. I recently worked with a customer who had some questions regarding the workflow of Software Metering in System Center 2012 Configuration Manager (ConfigMgr 2012) so I thought I would go ahead and share that with all of you here as well.

The information here is from a ConfigMgr 2012 R2 environment but if you’re looking for the same thing for System Center Configuration Manager 2007 (ConfigMgr 2007) then you can find that here:

Software Metering Rules Propagation and Enforcement

Creating the Software Metering rule

To get started with ConfigMgr 2012, first we create a Software Metering rule. In our example we will create a rule for Notepad as shown below:

clip_image002

clip_image004

Tracking Policy Creation and Compilation

Clients receive the new policy once we enable the Metering Rule. It’s processed when the Software Metering cycle runs as shown here:

clip_image008

As we can see, every time we create a new Software Metering rule the version of the policy (037effca-e41f-4f28-86a8-ad7481a51deb) changes. In our example, after creating a 3rd rule for Notepad the version changes to 3.00. Below is the snippet from PolicyAgentProvider.log:

clip_image010

Here is what we see during this process in PolicyAgent.log:

Requesting Machine policy assignments        PolicyAgent_RequestAssignments        9/24/2014 3:49:58 AM        4772 (0x12A4)

Total 1 PolicyAssignment(s) found.        PolicyAgent_ReplyAssignments        9/24/2014 3:49:59 AM        3564 (0x0DEC)

Policy Body :<PolicyAssignment PolicyAssignmentID=”{7da6c723-2d5d-4a50-8d30-53e714a2c984}”>

<Policy PolicyID=”{037effca-e41f-4f28-86a8-ad7481a51deb}” PolicyVersion=”3.00″ PolicyType=”Machine”>

Compiling policy ‘{037effca-e41f-4f28-86a8-ad7481a51deb}’ version ‘3.00’ hash

Initializing download of policy ‘CCM_Policy_Policy5.PolicyID=”{037effca-e41f-4f28-86a8-ad7481a51deb}”,PolicySource=”SMS:PR1″,PolicyVersion=”3.00″‘ from ‘http://SEC.contoso.com/SMS_MP/.sms_pol?{037effca-e41f-4f28-86a8-ad7481a51deb}.3_00        PolicyAgent_ReplyAssignments        9/24/2014 3:50:00 AM        3564 (0x0DEC)

Revoking policy ‘{037effca-e41f-4f28-86a8-ad7481a51deb}’ version ‘2.00’        PolicyAgent_PolicyDownload        9/24/2014 3:50:02 AM        3792 (0x0ED0)

Deleting policy ‘{037effca-e41f-4f28-86a8-ad7481a51deb}’ version ‘2.00’        PolicyAgent_PolicyDownload        9/24/2014 3:50:03 AM        3792 (0x0ED0)

Deleting policy file C:\Windows\CCM\Staging\{A56CBE49-456C-4575-ABCE-8B7C68309A71}.tmp        PolicyAgent_PolicyDownload        9/24/2014 3:50:03 AM        3792 (0x0ED0)

Recieved notification of policy download and evaluation complete for correlation guid {8CC44587-E82E-47AF-8449-BA069FF1683C}        PolicyAgent_RequestAssignments        9/24/2014 3:50:12 AM        4772 (0x12A4)

Synchronous policy assignment request with correlation guid {8CC44587-E82E-47AF-8449-BA069FF1683C} for Machine C1 completed with status 0        PolicyAgent_RequestAssignments        9/24/2014 3:50:12 AM        4772 (0x12A4)

After that we see these events in the mtrmgr.log:

Process ID 3772 is for process C:\Users\administrator\Desktop\CMTrace.exe     mtrmgr 8/29/2014 2:33:12 AM    2180 (0x0884)

Found match against RuleID PR100001   mtrmgr 8/29/2014 2:33:12 AM    4956 (0x135C)

Tracked usage for process 3772 mtrmgr 8/29/2014 2:33:12 AM    4956 (0x135C)

Check WMI Entries for the same

Next, this information is written into WMI with the help of Software Metering Storage Manager in root\ccm\SoftwareMeteringAgent. In here we have the classes shown below.

  • CCM_MeteredFileInfo – Holds details of  the *.exe that is being metered.
  • CCM_MeteredProductInfo – Similar information as that above.
  • CCM_RecentlyUsedApps – Holds the names of the files that were run recently.
  • CCM_HistoricalMeteredData – Records historical data.

Screenshots of these are included below.

clip_image012

clip_image014

This is then processed by the Software Metering Report Generator by fetching details from the Storage Manager and WMI. During this process, it transforms these files as XML and then into *.MUV.

After sending the report (as demonstrated below), it sends a request to purge the data in WMI which was already sent.

CSWMtrReportEndpoint::HandleMessage- Report Endpoint invoked.     SWMTRReportGen         8/29/2014 2:32:54 AM                2268 (0x08DC)

Generating report for usage data             SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

About to generate report header             SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

Successfully generated report header    SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

About to generate report body SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

Successfully generated report body        SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

About to generate report header             SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

Successfully generated report header    SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

MRU Refresh is 15 minutes.        SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

MRU Age limit is 90 days.              SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

CSWMtrReportEndpoint- Message ID of sent message: {D9ACA606-A6E6-4CE8-82E4-68E6DA86801B}                SWMTRReportGen         8/29/2014 2:32:54 AM    2268 (0x08DC)

This data is then sent to the MP_Relay Endpoint and then to swmproc.box for processing.  After this is done, and assuming a summarization runs on a schedule, we will be able to see all the details.

Workflow of the Software Metering Collection and Reporting

Below is the flow in an environment where we have a CAS, a Primary and a Secondary server. First the data is stored in the “C:\Windows\CCM\Metering” folder:

clip_image016

Then when the Software Metering cycle runs, its sends a report and is received by the MP_Relay Endpoint on the Secondary:

clip_image018

Next it is moved to swmproc.box on the Secondary for processing:

clip_image020

Now the Software Metering Processor on the Secondary adds the Usage File and then transfers it to Primary using file based replication:

image

We can see the Sender sending the files to the Primary Site Server:

image

At the Primary we can see the same files being received at the Despooler:

image

After the completion of replication, the *.MUV file is moved to the swmprox.box on the Primary:

image

It is then processed by the Software Metering Processor on the Primary:

image

The file move can be seen here in the folders on the Primary:

clip_image034

Once this has been done and the maintenance tasks are run, the metering data will be available for viewing on the console:

clip_image036

NOTE If you want to speed up this process you can trigger it manually, which can be useful if you’re troubleshooting a related issue. To do this, download the Configuration Manager 2012 Toolkit and install it. Once installed, look in the Server Tools folder for runmetersumm.exe. This file can be executed on the SQL instance hosting the Configuration Manager database to trigger the summarization process. The command to run is runmetersumm.exe DBName.

clip_image038

clip_image040

That’s the Software Metering workflow in a nutshell. And just for reference, below is an example of a MUX file captured during the Software Metering Workflow:

<?xml version=’1.0′ encoding=’UTF-16′?>
<Report>
<ReportHeader>
<Identification>
<Machine>
<ClientInstalled>1</ClientInstalled>
<ClientType>1</ClientType>
<ClientID>GUID:E58CDD17-B377-49A0-9584-80224C12C827</ClientID>
<ClientVersion>5.00.7958.1000</ClientVersion>
<NetBIOSName>C1</NetBIOSName>
<CodePage>437</CodePage>
<SystemDefaultLCID>1033</SystemDefaultLCID>
</Machine>
</Identification>
<ReportDetails>
<ReportContent>Software\x0020Metering\x0020Data</ReportContent>
<ReportType>Full</ReportType>
<Date>20141001043107.864000-420</Date>
<Version>1.0</Version>
<Format>1.0</Format>
</ReportDetails>
</ReportHeader>
<ReportBody>
<ProductInfo CompanyName=”Microsoft Corporation” ProductName=”System Center 2012 Configuration Manager” ProductVersion=”5.00.7804.1000″ ProductLanguage=”0″>
<SoftwareFileInfo FileDescription=”Configuration Manager Trace Log Tool” FileVersion=”5.00.7804.1000 (hermbld.121121-2357)” FileName=”CMTrace.exe” FileSize=”678480″>
<HistoricalMeterData MeteredDataID=”F32846B9-7846-44D4-9162-4F54D2D0A54F” UserName=”CONTOSO\Administrator” StartTime=”20141001042204.000000-420″ EndTime=”20141001043107.911000-420″ Status=”1″></HistoricalMeterData>
<HistoricalMeterData MeteredDataID=”C0C6FE62-3793-48D2-998D-BA036F2F345C” UserName=”CONTOSO\Administrator” StartTime=”20141001040049.000000-420″ EndTime=”20141001043107.911000-420″ Status=”1″></HistoricalMeterData>
</SoftwareFileInfo>
</ProductInfo>
</ReportBody>
</Report>

This shows the data sent from a client after the Software Metering cycle is run.

Pramod Sathyanarayana Kashyap | Support Engineer

Get the latest System Center news on Facebook and Twitter:

clip_image001 clip_image002

System Center All Up: http://blogs.technet.com/b/systemcenter/

Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/
Data Protection Manager Team blog: http://blogs.technet.com/dpm/
Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/
Operations Manager Team blog: http://blogs.technet.com/momteam/
Service Manager Team blog: http://blogs.technet.com/b/servicemanager
Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm

Microsoft Intune: http://blogs.technet.com/b/microsoftintune/
WSUS Support Team blog: http://blogs.technet.com/sus/
The RMS blog: http://blogs.technet.com/b/rms/
App-V Team blog: http://blogs.technet.com/appv/
MED-V Team blog: http://blogs.technet.com/medv/
Server App-V Team blog: http://blogs.technet.com/b/serverappv
The Surface Team blog: http://blogs.technet.com/b/surface/
The Application Proxy blog: http://blogs.technet.com/b/applicationproxyblog/

The Forefront Endpoint Protection blog : http://blogs.technet.com/b/clientsecurity/
The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/
The Forefront TMG blog: http://blogs.technet.com/b/isablog/
The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/

System Center 2012 Configuration Manager System Center 2012 R2 Configuration Manager ConfigMgr 2012 R2