Identifying Collections A Computer Is in
From the archive (2009). Written for the tools of the time, so some details may be out of date.
This query will show you what collections a computer is a member of. Thanks to Todd and Brian on the SCCM myITForum list.
Select
v_R_System.Name0, v_Collection.Name
From v_R_System
Left join v_FullCollectionMembership on v_FullCollectionMembership.ResourceId = v_R_System.ResourceId
Left join v_Collection on v_FullCollectionMembership.CollectionId = v_Collection.CollectionId
Where Name0 = ‘computer you’re looking for’