In this post, you’ll learn how to list SCCM application deployments using PowerShell script. Using a simple PS script you can find the names of applications, its software version and number of deployments as output.
Configuration Manager is the best tool to package and deploy applications. Applications are similar to packages in Configuration Manager, but contain more information to support smart deployment. You can read how to deploy applications using SCCM for both devices and users.
Most organizations have multiple SCCM administrators who create applications on a daily basis. As a result, the list of applications grows over time. When you have too many applications in SCCM, it becomes difficult to distinguish between those that are deployed and those that are not.
If you are asked to find the total deployments for an application in SCCM, you can either use Configuration Manager console or a PowerShell script. You can run a SQL query to find application deployment details. Out of the two, PowerShell script is much easier to find the application deployments. Before you read further, ensure you read the guide on how to connect and launch PowerShell from Configuration Manager console.
Before you read further, here are some useful guides relating to applications in SCCM:
- 3 Best Ways to Find the Package ID of SCCM Application
- Create and Deploy Application Groups in SCCM | ConfigMgr
- 7 SCCM Reports for Virtual Applications
- Duplicate Application in SCCM | Make a Copy of Application
- How to Retire an Application in SCCM | ConfigMgr
List SCCM Application Deployments Using PowerShell Script
Let’s find out how you can list SCCM application deployments using PowerShell. The Get-CMApplication cmdlet is used in the script below to retrieve a list of applications and their associated properties. Simply typing Get-CMApplication in PowerShell will return a list of applications and their properties. You can download the below script from my GitHub SCCM repository.
PowerShell script to list all the application deployments Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1' Set-Location P01: $FilePath = "C:\powershellscripts\test.csv" Get-CMApplication | Select-Object LocalizedDisplayName,SoftwareVersion,NumberOfDeployments | Export-CSV $FilePath
Allow me to explain the above script in brief and understand what exactly it does.
- In the first step, we import the Configuration Manager module using the Import-Module cmdlet. The import-module imports Configuration Manager module into PowerShell. In addition to importing the module, you will have to specify the path to the Configuration Manager Module. The path is usually “C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1“.
- We then define the site code of the SCCM site which is P01 in this case.
- Export the SCCM application deployments to a .csv file using $FilePath where you define the file name and it’s path.
- The last command is Get-CMApplication command. Here we filter the output with selected objects and export the output to the specified file path.
To run the PowerShell script, copy the code and paste in a new text document. Then you rename the file to something like this GetApplicationDeployments.ps1 extension. Launch the PowerShell and call the above script file to find all the application deployments. If you are choosing to export the output to a .csv file, review it using the Excel application.
Instead of running the above script, you can also use a single line PowerShell command to list all the application deployments in SCCM. To accomplish that, launch the Configuration Manager console and connect to PowerShell. After Windows PowerShell loads, you’ll see a prompt that contains your site code. For example, if the site code is “P01”, the prompt looks like: PS P01:> This confirms that you have connected to PowerShell from the SCCM console.
Now run the below PowerShell command to get all the application deployments.
Get-CMApplication | Select-Object LocalizedDisplayName,SoftwareVersion,NumberOfDeployments
Find Application Deployments in SCCM Console
In the Configuration Manager console, you can find the application deployments with following steps:
- Launch the ConfigMgr console.
- Go to Software Library > Application Management > Applications.
- Select an application from the list and the “Deployments” column shows total number of deployments.
You can also find the collections to which you have targeted the application deployments in the console.