Sample Queries for Software Metering in Configuration Manager

Oppdatert: januar 2014

Gjelder for: System Center 2012 Configuration Manager, System Center 2012 Configuration Manager SP1, System Center 2012 R2 Configuration Manager

The following sample queries demonstrate how to join the most common software metering views to other views.

The following query lists all resources that have run metered files, including the resource name, file ID, file name, file version, and start time. The v_MeterData software metering view is joined to the v_ProductFileInfo software inventory view by using the FileID column and to the v_R_System discovery view by using the ResourceID column.

SELECT SYS.Netbios_Name0, PFI.FileID, PFI.FileName, 
PFI.FileVersion, MD.StartTime 
FROM v_MeterData MD INNER JOIN v_ProductFileInfo PFI 
ON MD.ResourceID = SYS.ResourceID 
ORDER BY SYS.Netbios_Name0, PFI.FileName 

The following query lists all users who have run metered files. The query returns the user domain, user name, file name, file version, usage count, total time of usage, and the last time the file was used. The v_MeteredUser software metering view is joined to the v_MonthlyUsageSummary status view by using the MeteredUserID column. The v_MonthlyUsageSummary status view is joined to the v_GS_SoftwareFile software inventory view by using the FileID column.

SELECT MU.Domain, MU.UserName, SF.FileName, SF.FileVersion, 
MUS.UsageCount, MUS.UsageTime, MUS.LastUsage 
FROM v_MeteredUser MU INNER JOIN v_MonthlyUsageSummary MUS 
ON MU.MeteredUserID = MUS.MeteredUserID INNER JOIN 
v_GS_SoftwareFile SF ON MUS.FileID = SF.FileID 
ORDER BY MU.Domain, MU.UserName, SF.FileName 

Se også

For additional resources, see Information and Support for Configuration Manager.

Tip: Use this query to find online documentation in the TechNet Library for System Center 2012 Configuration Manager. For instructions and examples, see Search the Configuration Manager Documentation Library.