Tag Archive: collection

SCCM Collection Query – Duplicate host names

SCCM sometimes creates duplicate host name records.  When this happens you will see 2 or more records in your SCCM console showing the same host name or computer name, but with different GUID’s and different resource id’s.  In most cases one record will show as being an active client while the other shows it is not a client.  It is usually a safe bet to remove the non-client record, but be sure to check both records for the creation date as that may help to decide which one is the correct one to keep.

This collection query will show you the duplicate host name records.

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

I use this collection as a maintenance collection so that I can check for duplicate host names daily.  If you don’t remove the duplicate SCCM does not know which record should receive policies.  Once a single instance remains you will see that SCCM downloads policies to it.