Let’s find out the SCCM Application Deployment Custom Report SQL Query with Collection. I have seen many questions in HTMDForum that we want the application-related reports, how to write a SQL query to write a report on app deployment etc…
In this post, you will learn how to make a working Configuration Manager SQL query to find application status directly database. You can customize the query as per your need.
The following is the sample query that shall help you to understand the views which are required to get the ConfigMgr Application report working.
NOTE! – Thanks to Karthik for sharing this query in the Forum.howtomanage.com thread – https://forum.howtomanagedevices.com/endpointmanager/configuration-manager/is-there-any-sql-query-for-finding-the-status-of-deployed-application-in-sccm/
SQL Query
Once you have initiated the client push installation method. You can track the status of the application deployment using the following query. The following is one of the many ways to get the app deployment status from ConfigMgr.
- Open the SQL Management Studio.
- Click on the New Query button.
- Select the CM_MEM database from the drop-down menu.
- MEM is the ConfigMgr site code.
- Copy the following SQL query to find the report of application deployment with collection details.
- Click on the Execute button.
NOTE! – This report includes the following details ..
- Deployment Types -> Available or Required
- Deployment Time
- Application Creation Time
- Last Modified Time
- Last Modify by
- Etc…
Select
Pac.PackageID as 'App_ID',
col.CollectionID as 'AppCollection_ID',
Vaa.ApplicationName as 'ApplicationName',
Ds.CollectionName as 'CollectionName',
CASE when col.CollectionType = 1 Then 'User' when col.CollectionType = 2 Then 'Device' Else 'Others' End as 'CollType',
CASE when Vaa.DesiredConfigType = 1 Then 'Install' when vaa.DesiredConfigType = 2 Then 'Uninstall’' Else 'Others' End as 'DeploymentType',
CASE when Ds.DeploymentIntent = 1 Then 'Required' when Ds.DeploymentIntent = 2
Then 'Available' when Ds.DeploymentIntent = 3 Then 'Simulate' End as 'Purpose',
Ds.DeploymentTime as 'AvailableTime',
Ds.EnforcementDeadline as 'RequiredTime',
Vaa.CreationTime as 'CreatedOn',
Vaa.LastModificationTime as 'LastModifiedOn',
Vaa.LastModifiedBy as 'LastModifiedBy'
from v_DeploymentSummary Ds
left join v_ApplicationAssignment Vaa on Ds.AssignmentID = Vaa.AssignmentID
left join v_Package Pac on Vaa.ApplicationName = Pac.Name
left join v_collection col on Ds.CollectionName = col.Name
Where Ds.FeatureType = 1
order by Ds.DeploymentTime desc
Results – Application Deployment Custom Report
The SQL query for application deployment status is very helpful in terms of troubleshooting SCCM app deployment issues. I have seen many scenarios where SCCM admins are struggling to get the overview details about the apps deployed, and modified details.
App_ID | AppCollection_ID | ApplicationName | CollectionName | CollType | DeploymentType | Purpose | AvailableTime | RequiredTime | CreatedOn | LastModifiedOn | LastModifiedBy |
MEM0001F | MEM00014 | Microsoft Edge | HTMD Collection | Device | Install | Required | 41:00.0 | 41:00.0 | 41:49.0 | 41:49.0 | MEMCM\anoop |
MEM0001E | MEM00014 | ConfigMgr Admin Console | HTMD Collection | Device | Install | Available | 01:00.0 | NULL | 01:47.0 | 01:47.0 | MEMCM\anoop |
MEM00016 | SMSDM003 | Firefox 75.0 | All Desktop and Server Clients | Device | Install | Required | 36:00.0 | 36:00.0 | 36:07.0 | 07:05.0 | MEMCM\anoop |
MEM00015 | SMSDM003 | Firefox v74 | All Desktop and Server Clients | Device | Install | Required | 02:00.0 | 02:00.0 | 02:20.0 | 02:20.0 | MEMCM\anoop |
Resources
- Deep Dive SCCM Application Model Troubleshooting – Client End
- How to get a report with Friendly scan errors
Very good Sir. Just created RDL and works perfectly.
That is great Deepak
Anoop, This provides when the deployment was created and the information of that said Application. Trying to figure out where\how to create a report where the end user can put in application and tell which devices have it?
I know it’s old blog but trying to clear backlog. I am asking help from “A, Karthikeyan” if i need any help/clarification in SQL Queries.
Posting the question to https://forum.howtomanagedevices.com/ is the best way to get all our questions cleared.
Thanks Anoop! I would have never found CollectionType, DesiredConfigType and DeploymentIntent due to the output types. Very Useful report! do you know of better schemas?
Thanks and All the Credits to Karthick here. I don’t have further details about this. But can try to find out later.
I know it’s old blog but trying to clear backlog. I am asking help from “A, Karthikeyan” if i need any help/clarification in SQL Queries.
Posting the question to https://forum.howtomanagedevices.com/ is the best way to get all our questions cleared.
Msg 208, Level 16, State 1, Line 1
Invalid object name ‘v_DeploymentSummary’. i am getting this error
Very Good Report Anoop Sir.
Really Worth and use full.. if i get an custom report for individual software deployment wise means thats great..