Show Windows Update Agent versions

This SQL query will count all WUA versions grouping by Server/Workstation platforms and WUA versions. WUA is the Windows Update Agent responsible for applying software updates on Windows systems.

SELECT 'Workstation' as 'Platform', WUAV.Version0 as 'Version', count(sys.Netbios_Name0) as 'Count'
FROM v_GS_WINDOWSUPDATEAGENTVERSION WUAV
JOIN v_R_System Sys ON WUAV.ResourceID = Sys.ResourceID
join v_GS_SYSTEM S on S.ResourceID=WUAV.ResourceID
WHERE WUAV.Version0 <> 'ISNULL' and S.SystemRole0='Workstation'
Group by WUAV.Version0
UNION
SELECT 'Server' as 'Platform', WUAV.Version0 as 'Version', count(sys.Netbios_Name0) as 'Count'
FROM v_GS_WINDOWSUPDATEAGENTVERSION WUAV
JOIN v_R_System Sys ON WUAV.ResourceID = Sys.ResourceID
join v_GS_SYSTEM S on S.ResourceID=WUAV.ResourceID
WHERE WUAV.Version0 <> 'ISNULL' and S.SystemRole0='Server'
Group by WUAV.Version0
ORDER BY Platform, WUAV.Version0 desc

WUA