Monday 9 December 2019

SCCM SQL Query - Machine Collection Count

SCCM SQL Query - Machine Collection Count

Machine collection count more than 2 collection

Note : excluding the built-in All Systems and All Desktops and Servers collections


SELECT v_R_System_Valid.Netbios_Name0
, count(v_FullCollectionMembership.CollectionID) As CollectionCount
FROM v_FullCollectionMembership
INNER JOIN v_R_System_Valid
  ON v_R_System_Valid.ResourceID = v_FullCollectionMembership.ResourceID
WHERE v_FullCollectionMembership.CollectionID NOT IN ('SMSDM003','SMS00001')
GROUP BY v_R_System_Valid.Netbios_Name0
HAVING count(v_FullCollectionMembership.CollectionID) > 1

No comments:

Post a Comment

SCCM SQL Query to get Bit-locker Recovery Key

  SELECT cm.Name, ck.RecoveryKeyId, cv.VolumeGuid, cvt.TypeName AS 'Volume Type', RecoveryAndHardwareCore.DecryptString(ck...