Report showing Office versions installed
Hi! I'm not familiar enough with SQL to create this on my own, and I found another post on this site that has almost exactly what I need.
That post can be found here: http://www.itninja.com/blog/view/how-to-show-how-many-office-installs-and-what-version-of-office-per-site
The SQL there is just missing something that lets me determine the device name. The SQL in that post works perfectly, however it brings back the results from my entire organization. I only need it for specific devices, in particular ones that start with certain letters/numbers. For instance, devices that start with G1A or G1B. Can someone help me modify this SQL to include that kind of variable? Thanks in advance!
SELECT MACHINE.NAME AS 'COMPUTER NAME', MACHINE.IP AS 'IP', SAM_VIEW_DISCOVERED_SUITES.NAME AS 'SOFTWARE',
/*
SAM_VIEW_DISCOVERED_SUITES.PRODUCT_NAME, SAM_VIEW_DISCOVERED_SUITES.MAJOR_VERSION,
*/
CASE WHEN MACHINE.IP LIKE '192.168.0.%' THEN 'OFFICE 1'
WHEN MACHINE.IP LIKE '192.168.1.%' THEN 'OFFICE 2'
WHEN MACHINE.IP LIKE '192.168.2.%' THEN 'OFFICE 3'
ELSE MACHINE.IP
END AS LOCATION
FROM SAM_VIEW_DISCOVERED_SUITES
LEFT JOIN SAM_VIEW_MACHINE_DISCOVERED_SOFTWARE ON SAM_VIEW_DISCOVERED_SUITES.ID = SAM_VIEW_MACHINE_DISCOVERED_SOFTWARE.ID
LEFT JOIN MACHINE ON MACHINE.ID = SAM_VIEW_MACHINE_DISCOVERED_SOFTWARE.MACHINE_ID
WHERE SAM_VIEW_DISCOVERED_SUITES.NAME like '%office%'
0 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
chucksteel
7 years ago
Top Answer
After the last line add:
AND MACHINE.NAME like "G1A%"
Comments:
-
Thank you! That works perfectly! - grumpyguy6 7 years ago