Share via


Sample Queries for Client Status in Configuration Manager

 

Updated: January 1, 2014

Applies To: 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 common client status views to other views.

Joining Client Status and Collection Views

This query lists each client computer in the site, the last time it requested policy, and the collections to which the computer belongs. The query uses the v_CH_PolicyRequestHistory view to read the last policy request time and joins, using the ResourceID column to the v_ClientCollectionMembers view.

SELECT        dbo.CH_PolicyRequestHistory.MachineID AS ResourceID, dbo.CH_PolicyRequestHistory.RequestTime, dbo.v_ClientCollectionMembers.CollectionID
FROM            dbo.CH_PolicyRequestHistory INNER JOIN
                         dbo.v_ClientCollectionMembers ON dbo.CH_PolicyRequestHistory.MachineID = dbo.v_ClientCollectionMembers.ResourceID