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. ”

Similar Messages

  • 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

  • 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

  • How to get SQL statement from (Collection) query.execute();

    We have a JDO Persistence class ClassName that execute query using following code. After this statement get executed, record does not get updated in the DB. Is there a way to check what SQL statement got submitted in the (Collection) query.execute(); ??? <br><br>
    Extent extent = pm.getExtent(ClassName.class, false); <br>
    Query query = null; <br>
    try { <br>
    query = pm.newQuery(extent, filter); <br>
    Collection results = (Collection) query.execute();<br>
    Iterator i = results.iterator();<br>
    if (i.hasNext()) {<br>
    ...<br>
    }<br>

    You can always find out the names of tables that are views, using java.sql.DatabaseMetaData and its getTables() method.
    This tends to be a nice source of examples:
    javaalmanac.com
    However, if you're asking for the underlying SQL used to CREATE VIEW, I don't see anything in the API that will give you that. After all, JDBC shouldn't have to know if it's dealing with an ordinary table or a view. I think you'd have to ask your DBA for the underlying SQL.
    Once you have it, what do you plan to do with it?
    %

  • 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

  • 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

  • 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%"

  • Device Collections - query for HyperV servers

    Is it possible to devise a Device Collection query that would only list servers running with the HyperV role ?

    select *  from  SMS_R_System inner join SMS_G_System_SERVICE on SMS_G_System_SERVICE.ResourceId = SMS_R_System.ResourceId
    where SMS_G_System_SERVICE.DisplayName = "Hyper-V Virtual Machine Management"
    Cheers
    Paul | sccmentor.wordpress.com

  • 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

  • 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 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

  • BULK COLLECT QUERY REWRITE

    I understand that Oracle 10g will rewrite your CURSOR FOR LOOP statements into a BULK COLLECT statement.
    I am contemplating no longer explicitly writing the BULK COLLECT from now on as it reduces the number of lines of code and greatly simplifies code.
    Can anyone see any serious flaws in this strategy?
    Kind Regards
    Chris

    > I also think it is a good idea if people do take the
    time to decide their strategy. You seem to be
    suggesting that it is a bad idea to stop and think
    about what you require from your loop.
    Well, that depends on the type of programmer. When one deals with programmers that are not true PL/SQL developers and view PL/SQL.. well, as some kind of inferior database language (compared to something like Java for example).. you want to have templates and stuff to enforce best practises.
    > I also don't agree with the 'package tuning knob'.
    Each query may have different requirements and, as
    with most things in programming, fixing one thing can
    have a negative effect on another. It is about the
    only place where would not advocate constants.
    You have a point - but even so, defining these as constants (even if it has to be inside the actual proc doing the bulk fetch, one per bulk fetch) make it a lot easier to maintain than having to search out the actual bulk fetch statements in the code.
    > But i would suggest that analysis is performed on a
    close-to-live enviroment with a production level
    server, large body of test data and multiple users. I
    think we agree on that point.
    Yeah.. but the problem there is that I have never really seen such an environment. Usually due to costs. How do you for example duplicate a large RAC, terabytes of SAN space, 1000's of users, for use as a close-to-live enviroment?
    The usual approach (by management) is to spend as little as possible on development and Q&A platforms. Which at times means that the performance of dev vs. production can vary a lot.
    So we have to play the hand we're dealt with unfortunately.
    > Hmmm cmegar and I have never once said "don't worry
    about, PL/SQL does it for you".
    Yes - of course not. I'm just rambling on in general describing the usual attitudes I see when it comes to features like this.
    It is managable in small dev team, but larger ones.. not really. There this attitude is often previlant in my experience. The "silver bullet" bullet syndrome.
    > Would you use the same argument with regard to unit
    testing. There are not many pl/sql developers who
    unit test but should that prevent me using the
    technique?
    Well.. to be honest, I do not think that a developer that writes at least some basic unit tests for his/her code can be called a developer.
    > >[i]Relying on implicit features to "fix" code for
    you negates a deeper and better understanding of the
    language and what you writeI don't see how using an implicit bulk collect is
    fixing code.
    Which is why I put it in brackets - "fixing" ito making it more performant, or "fixing" it as a FOR loop contains DMLs that can be changed to FORALLs.
    > Don't tell me you've never
    updated older code to take advangate of a new
    feature.
    I can never stop the urge to refactor old code I'm working with. :-)
    > >[i]I think of features as an implicit bulk collect
    behind the scenes, as crutches for mediocre
    programmers.I take it that statement is suggesting that cmedgar
    and I are mediocre programmers? Not a nice way to end
    an otherwise constructive argument.
    How does that saying go? You claim the cloth that I cut? :-)
    My sincere apologies to both you guys - I did not intend that statement to personal at all.
    Besides, I'm usually more blunt than that what it comes to throwing personal insults around. ;-)
    This statement was just a general observation going back to my early days of writing Cobol and Natural. Programmers at time do not seem to care about grokking the features and apply them correctly. Actually I want to say "most programmers" and "a lot of times", but then I would be accused of generalisation. ;-)
    I simply find it very frustrating dealing with programmers that does not simply love to write code. Programmers that see it as a mere job.
    Someone once said that he never starts out to write beautiful code. But when he is done and the code is not beautiful and elegant (and simple), he knows he has screwed up.
    In my experience.. many programmers will not understand this.

  • Struggling with collection Query

    Hi guys,
    I'm struggling to wrap my head around the queries for collection memberships.
    I've got quite a few computer collections attached to AD group memberships that I then use to deploy applications to. That way the helpdesk guys just put a PC in the group and the deployment takes care of itself.
    So I just us SYSTEM RESOURCE + SYSTEM GROUP is equal to GROUP NAME in the query designer. Simple.
    What I'm trying to do now is create an uninstall collection for applications that have specific licenses. No matter how I put it through the designer I can't figure it out.
    In plain language I want to say:
    If a computer has X application but is NOT in the AD group
    I can then push an uninstall deployment to that collection. Can anybody point me in the right direction?

    Assuming you've got the computer objects in your first collection, you can easily use that as an exclude collection to your second collection. So on your second collection create a query for the application and add and exclude for the first collection.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • SCCM 2012 R2-CU3 Collection Query not a report to generate Computers no longer logon to Active Directory for more than 90 Days.

    Dear Brothers,
    I want to use SCCM to have a
    Query Collection to generate computers no longer active by detecting more than 90 days of no logon to our AD (Dead or not Pinging but still in AD), after this activity I will delete this computers
    to completely clean both AD and SCCM records as Well.
    Why instead of Reports I prefer collection is because, I want it to be more Dynamic and once you open the console the computers will be displayed immediately.
    Regards,

    It is not possible for a collection to be more dynamic than a report. If anything the collection will be behind what is listed in a report.
    How exact do you think that you determine that a PC is not ping able via a collection? This might be possible via a report but it will be a very, very complex report to do this.
    As for logon details this is NOT collect by CM12 by default and it is could be update 15-22 days out of sync with reality.
    If I remember right there are a few scripts that will do this for you available via the favorite search engine.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ
    Thanks Garth,

  • Collection query for specific SCCM client version - Parameters?

    Good morning,
    I need to upgrade my older clients as I recently upgraded SCCM to SP2.  I can't seem to find the parameters in query builder to populate a collection with a specific SCCM client version.  Can anyone help me out or point me in the right direction?  I can't find anything using "The Google".  You'd think lots of people would want this that there'd be a default query in SCCM already.  Thanks.

    Here is a query of all clients running sp1 version:
    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_SMS_ADVANCED_CLIENT_STATE on SMS_G_System_SMS_ADVANCED_CLIENT_STATE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_SMS_ADVANCED_CLIENT_STATE.Version = "4.0.6221.1000"
    JonL

Maybe you are looking for

  • Use same external drive for 2 computers

    On my desk top I use an external hard drive to store my pictures. It is named local disk (m:). I want to work on pictures with my laptop, but when I connect external drive to laptop, is named local disk (f:). LR does not recognize this drive. I want

  • Cleaning a DVD player

    After making a DVD in iDVD I couldn't get the DVD to play without skipping in one of my DVD players. At first I thought it was the DVD but now I think maybe my DVD player might be dirty. If they get dirty. Because the DVDs(6) all player in another DV

  • Can anyone tell me how eject a disc and also the desktop shows no icon

    Can anyone tell me how to eject a disc from an imac.  Also the desktop doesn't show a disc icon.   Help!

  • 7.0 Standard problem

    i am having a problem with excel. when creating a pdf within excel my comments do not appear in the worksheets. i have 4 worksheets, the comments for the first worksheet appears but the 2,3 and 4th worksheets the comments do not appear in the pdf. an

  • New BH-905i on N96 fades every 11s the music for 1...

    Yesterday I received my new BH-905i (the batteries were fully charged overnight) which was easy to pair with my N96 (SW 30.033.098.1). But when listening to music from my 8GB microSD, the sound fades completly every 11s for 1s and then comes back for