Partager via


How to find SCCM duplicate computer objects

One of the many tasks an SCCM admin faces is checking for ConfigMgr duplicate computer records. There are many ways that we can get duplicate records, but here are the three most common:

Duplicate MAC Addresses.

I normally see this in environments where VDI is common. Generally, a VDI admin has duplicated machines without giving each a unique MAC address. This is bad and should be avoided. If you’re VDI admin has created a bunch of computers with the same MAC, we need to delete them from SCCM. To find these objects, run the following TSQL query:

 SELECT dbo.v_RA_System_MACAddresses.MAC_Addresses0, Count(dbo.v_R_System.Name0) AS SystemCount 
FROM dbo.v_R_System RIGHT OUTER JOIN dbo.v_RA_System_MACAddresses 
ON dbo.v_R_System.ResourceID = dbo.v_RA_System_MACAddresses.ResourceID 
GROUP BY dbo.v_RA_System_MACAddresses.MAC_Addresses0 ORDER BY SystemCount DESC
Duplicate Computer Names.

These are the most common duplicate objects. Most likely this occurs due to OSD or conflicting discovery cycles. We basically end up with two computer objects, with the same name/hardware/MAC but different SMSBIOSGUID. It causes much confusion for ConfigMgr because it often doesn’t know how to process the inventory for the phantom object. To find these objects, create an SCCM Query (or query based collection) with the following Query Statement:

 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
Duplicate HardwareID’s

One other way to look for dupes is to use the HardwareID. Use the following TSQL to find the objects with duplicate HardwareIDs:

 SELECT Name0, Hardware_ID0, Count(Hardware_ID0) AS SystemCount
FROM dbo.v_R_System
GROUP BY Hardware_ID0, Name0
ORDER BY SystemCount DESC
  
 Matt Shadbolt

Comments

  • Anonymous
    January 01, 2003
    I'm always getting duplicate computers due to OSD... I've already got a collection set up to detect these & manually delete them from time to time, however is there a way to prevent this from happening? Or atleast a way to automate the clean up? Cheers!

  • Anonymous
    December 11, 2013
    Excellent......thank you

  • Anonymous
    May 28, 2014
    Thanks Dude

  • Anonymous
    August 13, 2015
    Excellent, Thanks

  • Anonymous
    March 30, 2016
    Very Usefull, i was waiting for hours until i finaly get message "Device not found in the database" to bad i had an duplicated MAC in SCCM... :(

  • Anonymous
    May 05, 2016
    Excellent, works wonders for me. Thank you.

  • Anonymous
    September 22, 2016
    awesome, thanks for the query

  • Anonymous
    October 16, 2017
    how do you delete the entries once you find them with your query?

    • Anonymous
      October 17, 2017
      You can just delete them!