Thanks, but I want to do a different thing, I'll explain further. I got AD-computers. They all use the same task sequence for installing Windows 7. But there are many types of computers in the organisation, some need only a Citrix client, while others need more software, like Office. And then there are notebooks, that also need a client to log in remotely. For this reason, we created three AD-groups, called SCCM_Citrix, SCCM_MultimediaPC and SCCM_Notebook respectively. In principle, objects can only belong to one group, but can be upgraded to a different level (the new software packages are pushed then). In the software, there is however no limitation that an object can only be a member of one group. To check my colleagues for errors, I wanted to create a collection that shows me objects that are member of multiple groups.
In the beginning, there were only three groups, so I made a query for objects that were in SCCM_Citrix and SCCM_MultimediaPC, a different query for SCCM_Citrix and SCCM_Notebook and a query for SCCM_MultimediaPC and SCCM_Notebook. Please note that I'm talking about AD-groups here, but they all correspond to a single collection. But since the number of AD-Groups are growing, we wanted to use a different approach. The query should look something like:
select *
from SMS_R_System
where count(number of AD-collections the object is in) > 1
Hope this makes everything more clear. It is just for monitoring my colleagues (they just work with the AD-groups and don't know much about SCCM).