roharris33 Posted September 27, 2012 Report post Posted September 27, 2012 I apologize if there is something on this site about this. I've searched and searched but cannot find an answer. I have several printer deployments that are packages. I've also created collections for each department. I want to add all of the printer packages to my task sequence then add a condition to install a specific printer for a specific collection that the object is a member of. I've searched the internet but cannot seem to find a solution. I know that I can add a variable to the collection but since I want to automate the process that really isn't an option. What I've done so far is add a if statement followed by a WMI Query. I added the Query and tested but I get a "contains invalid syntax" error message followed by "Porrible reason: Invalid query. Basically the query should check the collection membership based on the computer name. At this point I don't even know if this is possible. Has anyone ever tried something like this? Are my commands wrong? I've also included my query below. SELECT * FROM Win32_ComputerSystem WHERE Name = SMS_R_System.Name in (select sys.resourceid from SMS_CM_RES_COLL_"CollectionName" AS coll, sms_r_system as sys where sys.resourceid = coll.resourceid) Any help will be appreciated. Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted September 27, 2012 Report post Posted September 27, 2012 You using WQL and SQL in one query.... Quote Share this post Link to post Share on other sites More sharing options...
roharris33 Posted September 27, 2012 Report post Posted September 27, 2012 Okay I'm new to this so I apologize in advance. I created a test query that returns the object in that particular collection. However I used this query in the task sequence and it failed. I think the reason that it failed is because it's not calling the name from the local computer. That's why I added FROM Win32_ComputerSystem. I'm wondering how I can call the local computer name and check the specified collection for that computer name. select SMS_R_System.Name from SMS_R_System where SMS_R_System.Name in (select sys.resourceid from SMS_CM_RES_COLL_"CollectionName" AS coll, sms_r_system as sys where sys.resourceid = coll.resourceid) Quote Share this post Link to post Share on other sites More sharing options...
roharris33 Posted September 28, 2012 Report post Posted September 28, 2012 Basically I want to query a collection from the task sequence in SCCM 2012. Has anyone done that? Quote Share this post Link to post Share on other sites More sharing options...
Carl_r Posted October 23, 2013 Report post Posted October 23, 2013 Okay I'm new to this so I apologize in advance. I created a test query that returns the object in that particular collection. However I used this query in the task sequence and it failed. I think the reason that it failed is because it's not calling the name from the local computer. That's why I added FROM Win32_ComputerSystem. I'm wondering how I can call the local computer name and check the specified collection for that computer name. select SMS_R_System.Name from SMS_R_System where SMS_R_System.Name in (select sys.resourceid from SMS_CM_RES_COLL_"CollectionName" AS coll, sms_r_system as sys where sys.resourceid = coll.resourceid) Any news on your side for this topic? Did you found another way to make it work? I have the same issue here. I want in a Task Sequence to install application base on the membership of the machine in differents collections. Thanks Carl Carl Quote Share this post Link to post Share on other sites More sharing options...