Answered by:
SCCM Query help

Question
-
Hello,
Can someone help with Simple SCCM WQL query?
I am trying to check two condition, the first is if a software is installed on a computer and the second is if that computer is belong to a AD security group.
This is the query I was build with the SCCM 2012 wizard but it doesn't work for me...
select SMS_R_System.Name, SMS_R_System.IPAddresses 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 = "Software 1.1" and SMS_R_System.SystemGroupName != "Domain\\SoftwareGroup" order by SMS_R_System.Name
This query only check the first condition and completely ignoring from the second.
Thanks.
Tuesday, December 3, 2013 6:04 AM
Answers
-
You have to use http://myitforum.com/cs2/blogs/jgilbert/archive/2008/07/22/subselect-queries-the-easy-way.aspx to exclude systems. != does not work in that case.
Torsten Meringer | http://www.mssccmfaq.de
Tuesday, December 3, 2013 9:58 AM -
On top of Torsten comment, keep in mind that your query will only find x86 software you will need to add the x64 to get everything.
http://www.enhansoft.com/
- Marked as answer by Joyce L Thursday, December 12, 2013 1:57 AM
Tuesday, December 3, 2013 11:22 AM
All replies
-
You have to use http://myitforum.com/cs2/blogs/jgilbert/archive/2008/07/22/subselect-queries-the-easy-way.aspx to exclude systems. != does not work in that case.
Torsten Meringer | http://www.mssccmfaq.de
Tuesday, December 3, 2013 9:58 AM -
On top of Torsten comment, keep in mind that your query will only find x86 software you will need to add the x64 to get everything.
http://www.enhansoft.com/
- Marked as answer by Joyce L Thursday, December 12, 2013 1:57 AM
Tuesday, December 3, 2013 11:22 AM -
select displayname0, "memberof"=
case when resourceid in # pull all your member of AD objects #
else "not a member"
end
from V_GS_ADD_remove_programs.
hope this logic will work out.
Sunday, January 26, 2014 2:38 PM