Sample Queries for Content Management 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 the most common content management views to other views.
Joining Software Distribution and Package Status Views
The following query lists all packages by package ID and package name, the current status of each package, the Network Abstraction Layer (NAL) path for the distribution point, and the last time the package was refreshed on the distribution point. The v_Package view is joined to the v_PackageStatusDetailSumm status view and v_DistributionPoint software distribution view by using the PackageID columns.
SELECT PCK.PackageID, PCK.Name as PackageName, PSD.Targeted,
PSD.Installed, PSD.Retrying, PSD.Failed, DP.ServerNALPath,
DP.LastRefreshTime
FROM v_Package PCK INNER JOIN v_PackageStatusDetailSumm PSD
ON PCK.PackageID = PSD.PackageID INNER JOIN v_DistributionPoint DP
ON PCK.PackageID = DP.PackageID
ORDER BY PCK.PackageID