Solved

SCCM SQL Query - List computers with multiple version of Java

Posted on 2013-01-06
2
1,857 Views
Last Modified: 2013-02-18
Hi Everybody,

I plan to uninstall old version of Java (6U37) if computer has both version of Java (6U37 and 7U10). I created the following SQL statement for my collection on SCCM…
select

SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join     SMS_G_System_ADD_REMOVE_PROGRAMS on     SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId     where (SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Java 7 Update 10")   or
(SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Java(TM) 6 Update 37")

This shows all the computer which has one or the other version of Java but I cannot make it work to show only computer(s) which has both version of Java installed.

Can anybody to help with this SQL statement? Any help would be greatly appreciated?
Thanks.

Emese
0
Comment
Question by:Szuromi
2 Comments
 
LVL 17

Accepted Solution

by:
Kent Dyer earned 250 total points
ID: 38749584
Something like this should do it..  You will probably need to do some tweaking/changes, but you should get the idea.
SELECT sms_r_system.resourceid,
       sms_r_system.resourcetype,
       sms_r_system.name,
       sms_r_system.smsuniqueidentifier,
       sms_r_system.resourcedomainorworkgroup,
       sms_r_system.client.
Count(sms_g_system_add_remove_programs.displayname) as count_of_JAVA
FROM   sms_r_system
       INNER JOIN sms_g_system_add_remove_programs
               ON sms_g_system_add_remove_programs.resourceid =
                  sms_r_system.resourceid
WHERE  ( sms_g_system_add_remove_programs.displayname = "java 7 update 10" )
        OR ( sms_g_system_add_remove_programs.displayname =
             "java(tm) 6 update 37" )
Having COUNT(sms_g_system_add_remove_programs.displayname) > 1

Open in new window

HTH,

Kent
0
 

Author Closing Comment

by:Szuromi
ID: 38903755
Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question