Count installs per application and version
SQL query for the Configuration Manager database that counts how many computers have each application and version installed.
LanguageSQL
What it does to the systemReads only. It changes nothing.
Before you upgrade or remove software, you need to know how many versions are in use. This query counts them for you.
The result shows one row per application, version and publisher. It shows the number of computers for each row, largest first.
SQL
-- Use '%' to count every application. Use '%Adobe%' to count one product family.
DECLARE @AppName NVARCHAR(255) = '%';
SELECT
arp.DisplayName0 AS Application,
arp.Version0 AS Version,
arp.Publisher0 AS Publisher,
COUNT(DISTINCT arp.ResourceID) AS Computers
FROM v_Add_Remove_Programs arp
WHERE arp.DisplayName0 LIKE @AppName
GROUP BY arp.DisplayName0, arp.Version0, arp.Publisher0
ORDER BY Computers DESC, arp.DisplayName0, arp.Version0;
How to use it
- Open SQL Server Management Studio and connect to the site database.
- Paste the query into a new query window.
- Leave
@AppNameas'%'to count every application. - Change
@AppNameto a name with%signs to count one product. - Run the query.
Good to know
- The count uses distinct computers. A computer with both a 32-bit and a 64-bit entry counts once.
- The data comes from hardware inventory. Rows with no display name do not match the filter.
installed software
software count
v_Add_Remove_Programs
More SCCM SQL queries
List all computers with a named application installed
Check BitLocker protection status for each computer
Check distribution point content status for a package
Check software update compliance for one update
Count computers by manufacturer and model
Count Configuration Manager client versions in your environment