Collection membership by computer

Hi all,

Following on from the previous post about locating specific collections within SCCM, I recently created a report in SCCM showing which collections a machine is a member of. I’m sure this is already on the web somewhere but hopefully will help someone out!

SQL
select v_FullCollectionMembership.CollectionID, v_Collection.Name
from v_FullCollectionMembership 
join v_Collection ON v_FullCollectionMembership.CollectionID = v_Collection.CollectionID
where  v_FullCollectionMembership.Name = @ComputerName

Prompt details
Name:
ComputerName

Prompt SQL Statement:
begin  if (@__filterwildcard = ”)   SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS WHERE SYS.Client0=1 ORDER By SYS.Netbios_Name0  else   SELECT DISTINCT SYS.Netbios_Name0 from v_R_System SYS WHERE SYS.Client0=1    and SYS.Netbios_Name0 like @__filterwildcard   ORDER By SYS.Netbios_Name0 end