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

    Thursday, April 04, 2013 8:32 PM

All replies

  • I believe you use a package / program.  In the program - advanced tab specify "Run another program first:" which should install your first program prior to installing the second.  I may not be understanding your question correctly.
    Thursday, April 04, 2013 9:19 PM
  • Hi,

    No, I am not using package/program. I am using Application in SCCM 2012 which is new way of deploying software. App A is already deployed long back and now I need to deploy App B with the condition in my first statement which i have put in this blog..

    Thanks & Regards Uttam

    Thursday, April 04, 2013 9:39 PM
  • Have you already thought about supersedence? AppB supersedes AppA (without uninstalling AppA).

    Torsten Meringer |

    Friday, April 05, 2013 6:33 AM
  • 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

    Friday, April 05, 2013 3:17 PM
  • Hi All,

    As I stated above, can we modify the below query as per my requirement. Please help me on this.

    Thanks & Regards Uttam

    Friday, April 12, 2013 10:44 PM
  • Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?

    Why do you need the last logon user? If all you are going to do it deploy this application to any computer that has the application, then adding the last logon user will have no benefit.

    If you really want to do it then add SMS_R_System.LastLogonUserName to the query.

    Garth Jones | My blogs: Enhansoft and Old Blog site | Twitter: @GarthMJ

    Friday, February 06, 2015 1:30 PM