SCCM Collection query

Dear,
I have created collection name it (No iTunes) and add below query to find computer does not have iTunes and in collection Limiting option selected other collection where all computer account stored but this does not apply as need.
would you please assist.
Select * from SMS_R_System inner join
SMS_G_System_Add_REMOVE_PROGRAM on
SMS_G_System_Add_REMOVE_PROGRAM.ResourceID =
SMS_R_System.ResourceID where
SMS_G_System_ADD_Remove_PROGRAM.DIsplayName != “iTunes”
[email protected]

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 where SMS_R_System.ResourceId
not in (SELECT SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID
FROM SMS_G_System_ADD_REMOVE_PROGRAMS
WHERE SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "itunes%" )
Keep in mind that this will only find x86 versions of iTunes.
Garth Jones | My blogs: Enhansoft and
Old Blog site | Twitter:
@GarthMJ

Similar Messages

  • SCCM collection Query - Wrong output

    Hi 
    We are working on Creating Dynamic SCCM collection which get populated based on following two condition
    1) Belongs to a Test OU in AD
    2) Doesn't have scom agent installed
    We have been trying to work out why following query doesn't populate collection with correct object instead populate by every object that exist in this OU. Seems like condition after AND is totally ignored. is there anything I am doing wrong here
    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_SERVICE on SMS_G_System_SERVICE.ResourceID =
    SMS_R_System.ResourceId where SMS_R_System.SystemOUName = "AD.local/Servers/DEV/Test" and SMS_G_System_SERVICE.DisplayName != "Microsoft Monitoring Agent"
    Where as below query is working and condition after AND is calculated and collection get populated with right objects.
    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_SERVICE on SMS_G_System_SERVICE.ResourceID =
    SMS_R_System.ResourceId where SMS_R_System.SystemOUName = "AD.MONASH.EDU/Managed/Servers/DEV/OCIO/SplunkTest" and SMS_G_System_SERVICE.DisplayName = "Microsoft Monitoring Agent"
    We tried with different combination such as "not like", "is null" etc etc. seems to us that as soon as we try have negative criteria after AND that criteria has been ignored.
    To my little knowledge of SQL query, condition after AND is not optional and has to meet, if it doesn't query should return no value.
    is this same with SCCM collection query? will appreciate if some one can shade some light here.
    Thank you in advance. 

    Thank you All for the reply
    Our End Goal is to be able to automate software/configuration deployment based on criteria we set. SCOM is first of the rank if you like and we want this to be hands off approach so when a server move into certain OU based on criteria server get populated
    into SCCM collection and SCCM pushes out software/configuration packages out to the server.
    but having said that if we have to create two collection to satisfy our two criteria than most likely we will need number of collections depending on numbers and types of criteria. This will make managing collection and their relationship more challenging
    and not sure if that is the path we want to take. This will need to be discussed through unless we find better solution.
    Thank you again

  • SCCM collection query to create ESX host machines

    Hello Everyone
    I am looking SCCM collection query to create  ESX host collection. Any one can share the query to create EST host machines collection please

    For the actual ESXi hosts you can't.
    For host machines, that would be a query for all virtual servers, like this one:
    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 where SMS_R_System.IsVirtualMachine = "True"
    Make sure you limit the above query to servers collection or you can expand it to include servers, like this:
    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_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId
    = SMS_R_System.ResourceId where SMS_R_System.IsVirtualMachine = "True" and SMS_G_System_OPERATING_SYSTEM.Caption like "%server%"

  • SCCM Collection query to get the Linux machines details

    Hi,
    Can I get the SCCM collection query to create list of Linux  machines . Please help me to get 

    Hi,
    Yes, you can.
    You use collections to manage groups of Linux and UNIX servers in the same way you use collections to manage other client types. Collections can be direct membership collections or query based collections that identify client operating systems, hardware
    configurations, or other details about the client that are stored in the site database. 
    For more information, please review the link below:
    How to Manage Linux and UNIX Clients in Configuration Manager
    http://technet.microsoft.com/en-us/library/jj573941.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • SCCM Collection Query All Clients where Advertisement not successful

    Hi
    I'm trying to create a collection with a dynamic membership query.
    I want only the clients on which an advertisement status is not successful.
    So I can see on which clients the advertisement didn't not apply.
    When I use this query, I see the clients on which the advertisement was successful:
    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 where SMS_R_System.ResourceId in (select ResourceID from SMS_ClientAdvertisementStatus where AdvertisementID = "BMA20408" and LastStateName = "Succeeded")
    So my idea was to set the != Succeeded
    But then I have no clients in the collection.
    Any Idea how I can solve that?

    Hi,,sorry, but it looks like that I'm too stupid for copy and paste.
    I tried this one:
    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 where SMS_R_SYSTEM.ResourceID not in (select SMS_ClientAdvertismentStatus.ResourceID
    from SMS_ClientAdvertisementStatus where SMS_ClientAdvertisementStatus.AdvertisementID = "P0120EFE" and SMS_ClientAdvertisementStatus.laststatusmessageID in (10021))
    and always, whe I want ot save the script I got the message that there is a mistake. I'm not able to find the mistake - can please anyone help me?
    Regards
    Rolf

  • Need to make collection Query statement by sccm 2012 sp1 for Count of Licenses by License Status

    I want to make collection Query statement by sccm 2012 sp1 for all windows activated and all non-activated windows.
    Ahmed Sherif

    Have a look at the Software Licensing Product attribute classes when creating a Query - remember to choose
    System Ressource when creating the Query. You would have to enable this class to be collected during Hardware Inventory. Go to
    Client Settings -> Hardware Inventory ->
    Set Classes -> Select Software Licensing Product.
    This Class is part of the Asset Intelligence classes so you could enable it from there as well.
    Another way to accomplish is to use Compliance Settings to get this information.
    Create a Configuration item that query the Win32_WindowsProductActivation WMI Class, if you are using XP and the
    SoftwareLicensingProduct class for later os´s
    Add this Configuration Item to a Baseline ad deploy it to your Collections as needed.
    When the Baseline has been evaluated you can use this information to create query
    Machines reported as compliant is actived and machines reported as Non-Compliant is not activated.
    You can read about the Win32_WindowsProductActivation WMI Class here:
    http://msdn.microsoft.com/en-us/library/aa394520(v=vs.85).aspx
    and the SoftwareLicensingProduct here:
    http://msdn.microsoft.com/en-us/library/cc534596(v=vs.85).aspx

  • SCCM 2012 Collection Query

    Hi All,
    I am using SCCM 2012 SP1 with SQL 2008 R2 SP1. I have scenario as below.
    App A is targeted to user based collection as Available (Optional).
    App B needs to be targeted to users who has successfully installed App A as Required(Mandatory).
    Note : As per application behaviour we cannot target App B to machine(Device) based collection, otherwise I would have created a query to pull out all the machines in a collection where App A is successfully installed on base of Add/Remove
    program display name.
    Question : I want to create a user collection query which will pullout last logged on user for all the machines where
    App A is installed successfully, so that I can target App B to this user based collection as Required(Mandatory). In this way if in future any other user is installing App A then that user will also get pulled out automatically to this user
    based collection.
    Its bit urgent for me. Request you please help me to get this query or let me know if there is any other way to achieve this.
    Thanks & Regards Uttam

    Hi Torsten,
    I really have not thought about supersedence but App B is not the upgrade or replacement for App A. If it would then we would have defined the relationship in supersedence. But App A and App B are entirely different applications. Functionality of App B depends
    upon App A, so both has to be there on the machine.
    Only the thing is App B should go to the users who has already installed App A on their machines. For this I would like to create user based collection but confused regarding query. How can we achieve this? I am thinking of to modify the below query
    to pull out last logged on user from the below collection query. I am using SCCM 2012 SP1 with SQL 2008 R2 SP1. How can I modify the below query?
    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 where ResourceId in  (select ResourceId from SMS_G_System_ADD_REMOVE_PROGRAMS
    where DisplayName="App A ARP name" and Version = "1.0.0")
    Thanks & Regards Uttam

  • How to create a group in SCOM 2012 R2 based on SCCM Collection?

    Is there a way to create a group in SCOM 2012 R2 based on sccm collection? I am planning to use that group for maintenance mode.
    Thanks, Samer

    Hi,
    I think you could query all the collectin members from SCCM database then use powershell to add them to a specific OU.
    How to Create Groups in Operations Manager
    http://technet.microsoft.com/en-us/library/hh298605.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • SCCM Custom Query

    Hello,
    I am looking for a 2007 SCCM custom query that will look for KB2964358 installed. My trouble lies when I specify the below query to see if an update is installed, and it only returns XP computers since it is looking for the ADD Remove Programs feature.
    ConfigMgr is not collecting the list of Software Updates (patches) for Window 7/Vista/ 2008/ 2008 Core operating systems. Because, on these operating systems this information is stored
    in “Win32_QuickFixEngineering”  WMI class (it’s not listed in Add Remove Programs) and the inventory of this class is NOT enabled in SMS_DEF.MOF (by def ault). Hence ConfigMgr. report won’t be able to provide these details unless and until you’ve enabled
    the appropriate WMI class in SMS_DEF.MOF. Is there any other way to look for an update installed in custom queries that will return Windows 7 machines as well?
    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 like "%KB2964358%"

    Hi,
    take a look at the article below to extend the SMS_DEF.mof file to include the WMI class.
    http://technet.microsoft.com/en-us/library/cc180866.aspx
    Blog: http://theinfraguys.com
    Follow me at Facebook
    The Infra Guys Facebook Page
    Please remember to click Mark as Answer on the answer if it helps you in anyway

  • Collection query to get the Linux machines details

     Hi,
    Can I get the collection query to create list of Linux  machines . Please help me to get 

    Hello, I think, you are asking about SCCM collections !??? if yes, kindly post your query no SCCM forums.
    if not, please elaborate your question?
    Devaraj G | Technical solution architect

  • Work Flow of Collection query

    Hi
    Can anyone tell me the flow of how collection query works. How it fetches the data from Active directory . Example
    I have written a query to collect systems from organization Unit in Active directory. I have enabled System discovery. I'm able to view the systems in sccm console.  How the flow happens over here.
    Thanks in Advance

    Collection queries do not retrieve anything from AD, they simply query the DB.
    The information in the DB can come from a variety of locations however. AD information in the DB is generally populated by AD Discovery although certain things like OU are also populated by Heartbeat Discovery (aka the data discovery cycle on a client).
    Thus, the flow is essentially, AD to DB.
    Jason | http://blog.configmgrftw.com

  • Collection query

    Dear Exprt,
    I have create collection and trying to add below query base of advertisement succeeded but i receive syntax error
    select sys.ResourceID,sys.ResourceType,sys.Name,sys.SMSUniqueIdentifier,sys.ResourceDomainORWorkgroup,sys.Client from sms_r_system as sys inner join SMS_ClientAdvertisementStatus as offer on sys.ResourceID=offer.ResourceID 
    WHERE AdvertisementID = ‘A0120005′ and LastStateName = ‘Succeeded’
    would you please assist
    [email protected]

    Try this
    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_ClientAdvertisementStatus join SMS_R_System on SMS_R_System.ResourceID = SMS_ClientAdvertisementStatus.ResourceID
    where SMS_ClientAdvertisementStatus.AdvertisementID in('A0120005') and SMS_ClientAdvertisementStatus.LastStateName In('Succeeded')
    http://www.mssccm.com/sccm-collections/collection-query-based-advertisement-last-staus/
    Narahari(Hurry) Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • IN NEED OF A SCCM 2012 QUERY THAT SHOWS LAST TIME SOFTWARE WAS USED OR OPENED

    Hello
    I am in need of an SCCM 2012 query that shows PCs that have Visio , Adobe Professional and Visual Studio and the last time each was used or opened. I have the query below which give me the PC name and the product. Any assistance will be very helpful
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    like "%adobe acrobat%pro%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    like "%visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%viewer%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service pack%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security
    update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hydra%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%MUI%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%amd%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%microsoft visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%vision%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%add-in%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    = "Microsoft Visual studio 2012 devenv" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hotfix%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service%"

    Did you create a software metering rule for each software title? if not then you need you do that first and it will take over a week before you see results.
    Also keep in mind that your query will only find x86 software titles.
    http://www.enhansoft.com/

  • SCCM 2012 QUERY THAT SHOWS SOFTWARE INSTALLED AND LAST TIME IT WAS USED OR OPENED

    Hello
    I am in need of an SCCM 2012 query that shows PCs that have Visio , Adobe Professional and Visual Studio and the last time each was used or opened. I have the query below which give me the PC name and the product. Any assistance will be very helpful
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    like "%adobe acrobat%pro%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    like "%visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%viewer%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service pack%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security
    update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hydra%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%MUI%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%amd%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%microsoft visio%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%vision%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%add-in%"
    select distinct SMS_R_System.NetbiosName, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName 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
    = "Microsoft Visual studio 2012 devenv" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%hotfix%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%security%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName
    not like "%update%" and SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName not like "%service%

    See me reply to your other post with the exact same details, in the CM07 forum.
    http://www.enhansoft.com/

  • Collection query for computers with windows management framework 3.0

    Hi,
    collection query for computers with windows management framework 3.0, but I cant found a way. I cant see that it is in the inventory data for SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName.
    So any way to get computers with windows management framework 3.0?
    /SaiTech

    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_SoftwareProduct on SMS_G_System_SoftwareProduct.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_SoftwareProduct.ProductName like "Windows Management Framework 3.0%"
    That won't work because as mentioned, it doesn't appear in ARP.
    Torsten's suggestion will work or you can resort to software/hardware inventory using the info at
    http://serverfault.com/questions/555100/methods-to-detect-version-of-windows-management-framework
    Jason | http://blog.configmgrftw.com

Maybe you are looking for