Collection Membership Query

‚ÄčIf you are ever in a situation where you do not have Roger Zanders Right-click tools and you want to track down what collections a device is a member of, use the query below.  

Collection Membership Query
SELECT FCM.Name, FCM.CollectionID, C.Name
FROM v_FullCollectionMembership AS FCM
LEFT JOIN v_Collection AS C on FCM.CollectionID = C.CollectionID
WHERE FCM.Name = @DeviceName
ORDER BY FCM.CollectionID