/build/static/layout/Breadcrumb_cap_w.png

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:
Posted by: chucksteel 3 years ago
Red Belt
1

Top Answer

After the last line add:
AND MACHINE.NAME like "G1A%"

Comments:
  • Thank you! That works perfectly! - grumpyguy6 3 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ