Collections Configuration Manager-a are used not only to deploy resources according to certain criteria (e.g., application to the location in organizational units of directory services or operating system versions), but can be used to install specific software.
With a larger number of collections, it turns out to be a difficult question to determine which collections a computer actually belongs to. The answer to such a question may be of interest to administrators of the management system, and therefore a query (Query) run from the Configuration Manager console may be a convenient method of determining the computer's membership in a collection.
The construction of such a query should take into account that you will need to specify the computer name as a parameter (this is more convenient than specifying ResourceID)
It will be necessary to create a new query:
Use the WQL expression as a criterion:
Of course, the query must be given a name, which will later identify it in the list of queries. After approving the contents and saving the Query object, you can run the query (Run Query). You will then be asked for the name of the computer.
After entering the name of the computer, we can get the result of the query:
In addition to the names of the collections, additional information is derived here, which can be omitted from the query construction. WQL query form:
SELECT SMS_Collection.Name, SMS_Collection.MemberCount, SMS_FullCollectionMembership.CollectionID, SMS_Collection.Comment
FROM SMS_FullCollectionMembership
JOIN SMS_R_System on SMS_FullCollectionMembership.ResourceID = SMS_R_System.ResourceID
JOIN SMS_Collection on SMS_Collection.CollectionID = SMS_FullCollectionMembership.CollectionID
WHERE SMS_R_System.Name = ##PRM:SMS_R_System.Name##