Retrieve collection based on specified CollectionVariable

Hi,

I am new to SCCM2012, and I try to migrate our back-end from SCCM2007 to SCCM2012. We were used to retrieve collection base on collection name, but with SCCM2012 flat structure, we want to change our way of retrieving collections, that is,  retrieving collection based on specific CollectionVariable instead, for instance: looping through every collection in SMS_CollectionSettings and looking for collection that has CollectionVariable name = certain name and value = certain value. 

Could anyone tell me how it could work? I tried to get all collections from SMS_CollectionSettings, but I don't know how to access CollectionVariable[]

Thanks!


August 7th, 2013 10:18pm

We were used to retrieve collection base on collection name, but with SCCM2012 flat structure, we want to change our way of retrieving collections, that is,  retrieving collection based on specific CollectionVariable instead


How did you retrieve them and why is that needed? Just trying to understand the scenario behind it.
Free Windows Admin Tool Kit Click here and download it now
August 7th, 2013 11:07pm

In SCCM2007, we retrieve parent collection ID base on collection name, for instance, "SELECT CollectionID FROM SMS_Collection WHERE Name = 'collection name'" 

then we pass the CollectionID we got to child query to get the collection information we need:

"SELECT Name, CollectionID FROM SMS_Collection WHERE CollectionID in (SELECT subCollectionID FROM SMS_CollectToSubCollect WHERE parentCollectionID = 'parent collection ID')"

But in SCCM2012, everything is flat, there is no such class like SMS_CollectToSubCollect, so we decide to retrieve/distinguish collection based on collection variables.

For instance, if a collection has a collection variable name set to "CollectionType" and value set to "OSImage", then we know this collection represents a OSImage; if the value set to "Software", then we know this collection represents a Software.

August 7th, 2013 11:39pm

Why would you use collection variables for this? Collection Variables are for use during OSD? Why wouldn't you use folders?

What and when would you use the above queries?

Free Windows Admin Tool Kit Click here and download it now
August 8th, 2013 12:55am

Why would you use collection variables for this? Collection Variables are for use during OSD? Why wouldn't you use folders?

What and when would you use the above qu

August 8th, 2013 3:24pm

Yes, I know this is an old post, but Im trying to clean them up. Did you solve this problem, if so what was the solution?

Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2015 12:40am

Since no one has answer this post, I recommend opening  a support case with Microsoft Customer Support Services (CSS) as they can work with you to solve this problem.

June 13th, 2015 3:19pm

Since no one has answer this post, I recommend opening  a support case with Microsoft Customer Support Services (CSS) as they can work with you to solve this problem.

Free Windows Admin Tool Kit Click here and download it now
June 13th, 2015 3:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics