Tag Archives: database

Find All Duplicated Computer Objects in SCCM Database…

SCCM_Logo

Here is the query that will find all duplicated computer objects in your database. Really useful when OSD is involved! Example of that we are trying to get rid of:

Now, in order to identify the duplicates we need to create a new collection with following query:

Code:

select R.ResourceID,R.ResourceType,R.Name,R.SMSUniqueIdentifier,R.ResourceDomainORWorkgroup,R.Client from SMS_R_System as r full join SMS_R_System as s1 on s1.ResourceId = r.ResourceId full join SMS_R_System as s2 on s2.Name = s1.Name where s1.Name = s2.Name and s1.ResourceId != s2.ResourceId and R.Client = null

Once done you can click on the collection itself and safely select “Delete Special” to remove all duplicates!

If you guys have any questions please leave a comment down below.

Find All Obsolete Computer Objects in SCCM Database

SCCM_Logo

Very quick query to find all obsolete computer objects in site system database:

Code:

SELECT
    SMS_R_SYSTEM.ResourceID,
    SMS_R_SYSTEM.ResourceType,
    SMS_R_SYSTEM.Name,
    SMS_R_SYSTEM.SMSUniqueIdentifier,
    SMS_R_SYSTEM.ResourceDomainORWorkgroup,
    SMS_R_SYSTEM.Client

FROM
    SMS_R_System
WHERE
    SMS_R_System.Obsolete = 1