Get notified about duplicate host names in SCCM

Get notified about duplicate host names in SCCM

As part of the general maintenance and upkeep of SCCM we have a “Duplicate Host Names” collection in SCCM.

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.

https://blogs.technet.microsoft.com/configmgrdogs/2011/12/18/how-to-find-sccm-duplicate-computer-objects/

This collection finds duplicate host names but unfortunately does not notify us when one is found. The script below will send an e-mail when the collection membership is greater than 0. We have it set up as a scheduled task that runs daily.

Preview of e-mail notification

If you do not have a “Duplicate Host Names” collection you can create it by adding this query rule to a collection.

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

Alternatively you can run this PowerShell command:

Leave a Reply

Up Next:

Wish I knew this trick years ago (CMD/PoSH)

Wish I knew this trick years ago (CMD/PoSH)