Count SCCM Client Versions

The following SQL query counts the SCCM client versions by workstations and servers. Note: this will only return count of Windows based clients. If you have Linux/Unix based or Mac, the where clause should be modified to remove Operating_System_Name_and0 criteria.

/* Count CM Client Versions by Workstations and Servers */
select 'Workstations' as 'Platform', Client_Version0, Count(Client_Version0) as 'Count' from v_R_System
where Client0 =1 and Operating_System_Name_and0 like '%workstation%'
Group by Client_Version0
UNION
select 'Servers' as 'Platform', Client_Version0, Count(Client_Version0) as 'Count' from v_R_System
where Client0 =1 and Operating_System_Name_and0 like '%server%'
Group by Client_Version0
Order by Platform, Client_Version0 desc