Finding Unused SCCM Applications with SQL: A Quick Reporting Query
In every SCCM (Microsoft Endpoint Configuration Manager) environment, unused or unreferenced applications gradually accumulate over time. These unused applications clutter the console, consume storage, and complicate administrative tasks such as audits, cleanup, and migration.
To help identify such applications, here is a SQL query that lists SCCM applications that exist in the environment but are not deployed, not referenced in task sequences, and have no dependent relationships. This report is very useful for cleanup and housekeeping activities.
SQL Query: Identify Unused/Orphaned SCCM Applications
What This Query Does
This SQL query helps you quickly identify SCCM applications that are:
✔ Not deployed to any collection
apps.NumberOfDeployments = 0
✔ Not referenced in any task sequence
tspr.PackageID IS NULL
✔ Not depended on by other task sequences
apps.NumberOfDependentTs = 0
✔ Not assigned to any users or devices
ass.AssignmentName IS NULL
✔ Latest version of the application only
apps.IsLatest = 1
✔ Applications only (not packages, drivers, OS images, etc.)
PackageType = 8
This gives you a clean, filtered list of orphaned or unused applications that can be reviewed for retirement or cleanup.
Columns Returned by the Report
The result includes helpful administrative fields:
-
ApplicationName – Display name of the application
-
Description – App description (if provided)
-
Version – Software version
-
Manufacturer – Vendor or publisher
-
CreatedBy / DateLastModifiedBy – Who created or modified the app
-
PackageID – Package ID associated with the application
-
PackageType – Interpreted using the CASE statement
-
NoofDT – Number of deployment types
-
NumberOfDeployments – Total deployments
-
NumberOfDependentTs – Task sequences that depend on it
These fields help administrators understand the lifecycle and usage of each application.
Why This Report Is Useful
1. Cleanup and Housekeeping
This report helps identify applications that can safely be deleted or reviewed because they are not actively used.
2. Migration Projects
Before migrating to:
-
A new SCCM site
-
Intune
-
A new infrastructure
This report helps detect unused apps to avoid migrating unnecessary content.
3. Compliance and Inventory
Auditors or admins can verify which apps are actively managed vs. inactive.
4. Environment Optimization
Removing unused apps improves:
-
Console performance
-
Content library organization
-
Storage utilization
How to Run the Query
-
Open SQL Server Management Studio (SSMS)
-
Connect to the SCCM site database (e.g.,
CM_ABC) -
Open a new query window
-
Paste the SQL query
-
Execute and review the output
No comments:
Post a Comment