How to pull SCCM application content data using SQL, how to report on SCCM application content through SQL queries: -
Introduction: Why Application Content Reporting Matters
-
In SCCM/MECM environments, applications often contain multiple deployment types and associated content files.
-
Understanding application metadata, deployment technologies, and content size/location is essential for:
-
Application audits
-
Content management and cleanup
-
Migration assessment (SCCM → Intune)
-
Troubleshooting deployment issues
-
Optimizing disk usage on Distribution Points
-
-
SCCM does not include a built-in report that clearly correlates all this information, so SQL queries become highly useful.
2. Purpose of the SQL Query
Explain what the query is designed to do:
-
Pull a list of all latest SCCM applications.
-
Display their deployment types and priority.
-
Show technology type (MSI, Script, PowerShell, AppX, etc.).
-
Fetch content source (network path or source folder).
-
Retrieve content size from the content library.
-
Provide a single consolidated view of all applications and their content.
This query is popular for application inventory, planning, cleanup, and documentation.
3. SQL Query (Formatted for the Blog)
4. Explanation of Each SCCM SQL Function/Table
▶ fn_ListLatestApplicationCIs (1033)
-
Lists all latest application versions.
-
Key fields:
-
Application Name
-
Manufacturer
-
Model Name (used for joining to deployment types)
-
▶ fn_ListDeploymentTypeCIs (1033)
-
Returns deployment type CI information.
-
Displays:
-
Deployment Type Name
-
Technology (MSI, Script, etc.)
-
Priority
-
Content ID
-
▶ V_ContentInfo
-
Correlates deployment types to their content.
-
Shows:
-
Content Source Path
-
Content Size
-
Unique Content ID
-
5. What the Report Shows
The query returns:
| Field | Description |
|---|---|
| Manufacturer | Vendor name (Adobe, Microsoft, etc.) |
| DisplayName | Application name |
| DeploymentTypeName | Install script, MSI installer, AppX package, etc. |
| PriorityInLatestApp | DT run order |
| Technology | MSI, Script, PowerShell, IntuneWin, etc. |
| ContentSource | Original file location used to create the app |
| SourceSize | Total size of the application content |
This gives admins a complete view of application structure + content details.
6. Use Cases for SCCM Admins
✔ Content Library Cleanup
Identify:
-
Large applications
-
Duplicate content
-
Missing source paths
✔ Application Audit
Get clarity on how applications are built.
✔ Migration Planning
Helpful when moving to:
-
Intune
-
New SCCM infrastructure
-
Application modernization projects
✔ Deployment Troubleshooting
Useful when apps fail because of:
-
Wrong content source
-
Missing files
-
Incorrect deployment type priority
✔ Compliance & Documentation
Generate documentation for audit teams.
7. How to Run the Query in SCCM
Provide steps:
-
Open SCCM Console
-
Navigate to Monitoring → Database → SQL Server Views
-
Open SQL Server Management Studio (SSMS)
-
Connect to your SCCM site database
-
Paste the SQL query
-
Run the query to generate your report
(Optional: include screenshots in your blog.)
8. Enhancing the Report (Optional)
Admins can modify the query to include:
-
App creation date
-
Last updated date
-
User experience details
-
Detection method type
-
Content hash info
-
Distribution status
Mention that these additions depend on needs.
9. Conclusion
Summarize:
-
SCCM does not provide a single built-in report for application + content data.
-
This SQL query provides a clear, detailed overview of:
-
Application metadata
-
Deployment types
-
Technologies
-
Content source
-
Content size
-
-
Essential for auditing, troubleshooting, and managing application lifecycle.
No comments:
Post a Comment