How to check whether an application has Dependencies and References

Boopathi Subramaniam 3,281 Reputation points
2021-11-13T14:12:35.817+00:00

Hello,

I am working on cleaning up Application Contents.
There are applications with 0 deployment. But those applications have
Dependencies and Reference with other applications.

Please let me know how to check whether an application has Dependencies and References using PowerShell or SQL Query.
149017-untitled.jpg

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
467 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Amandayou-MSFT 11,051 Reputation points
    2021-11-15T06:48:47.337+00:00

    Hi @Boopathi Subramaniam ,

    We could use the following SQL query to check if the application has Dependencies:

    SELECT DISTINCT  
    ParentApp.DisplayName ParentAppName,  
    ParentAppF.Name ParentAppFolder,  
    ParentApp.CreatedBy ParentAppCreatedBy,  
    ParentAppDT.DisplayName ParentAppDTName,  
    ChildApp.DisplayName ChildAppDisplayName,  
    ChildAppF.Name ChildAppFolder,  
    ChildAppDT.DisplayName ChildAppDTName  
    FROM   
    fn_ListApplicationCIs(1033) ParentApp  
    LEFT JOIN vFolderMembers ParentAppFM on ParentAppFM.InstanceKey = ParentApp.ModelName  
    LEFT JOIN vSMS_Folders ParentAppF on parentAppF.ContainerNodeID = ParentAppFM.ContainerNodeID  
    LEFT JOIN fn_ListDeploymentTypeCIs(1033) ParentAppDT on ParentAppDT.AppModelName = ParentApp.ModelName  
    LEFT JOIN vSMS_AppRelation_Flat R on R.FromApplicationCIID = ParentApp.CI_ID  
    LEFT JOIN fn_ListApplicationCIs(1033) ChildApp on ChildApp.CI_ID = R.ToApplicationCIID And ChildApp.IsLatest = 1  
    LEFT JOIN vFolderMembers ChildAppFM on ChildAppFM.InstanceKey = ChildApp.ModelName  
    LEFT JOIN vSMS_Folders ChildAppF on ChildAppF.ContainerNodeID = ChildAppFM.ContainerNodeID  
    LEFT JOIN fn_ListDeploymentTypeCIs(1033) ChildAppDT on ChildAppDT.AppModelName = ChildApp.ModelName  
    WHERE  
    ParentApp.IsLatest = 1  
    AND ParentAppDT.IsLatest = 1  
    AND ChildApp.IsLatest = 1  
    AND ChildAppDT.IsLatest = 1  
    ORDER BY 1  
    

    I test it in my environment, it could be shown childAPPDTName which the application has Dependencies:

    149274-1115.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Boopathi Subramaniam 3,281 Reputation points
    2021-11-15T20:04:32.897+00:00
    1 person found this answer helpful.