Few days back,I was working on Client health remediation issues.for this activity,I created some cool SSRS reports based on client health statistics(soon,will post them on the blog) how many are with client,without client etc.
count of missing clients are not too bad (few hundreds) but still need to get possible clients* into configmgr console using different client installation methods like client push,logon script etc.
During this process,I found many clients are with duplicate records,obsolete ,multiple resource ID with same computer name.More via http://social.technet.microsoft.com/Forums/systemcenter/en-US/8f3fd7cd-0e3d-4429-bcde-02b2ec77324d/report-showing-servers-showing-two-os?forum=configmgrgeneral#ac775d37-141a-404c-a345-7d882b1bbe17
the above issues are addressed in multiple blogs—- how to create collection to find duplicate records and delete them from database but I thought of presenting all in this blog including new issue—One computer with different Resource IDs
I ran below SQL query on SSMS (management Studio) ,found many entries .pick one computer and ran select * from v_r_system where name0=’computer name’ .This results 2 entries for one computer name,both the computers are active,No Obsolete,Client is 1 ,what else I can check to differentiate between .This is really confusing ,you should try to fix it by somehow else you will impact on patch compliance % because only one computer will send the compliance report but no other.
select sys.name0
from v_r_system sys
group by sys.name0
having count(sys.name0) >=2
How do you cleanup this mess from Database ?
Created a collection with all these entries using query based or what ever you prefer and delete them from database.don’t worry though,these deleted computers will be back to the console with their next DDR cycle.
List of collection you need to have in place to cleanup duplicate entries are:
Duplicate Computer Names:
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
Duplicate Resource ID with same Computer Name(based on Active Status):
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.Active is null and SMS_R_System.Name in (select Name from SMS_R_System where SMS_R_System.Active = "1")
Obsolete Computers:
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" and SMS_R_System.Name not like "Unknown"
You can either manually delete the entries from collection or create schedule job which performs delete resources from the collection using task scheduler .
SCCM Configmgr 2012 Delete duplicate ,Obsolete records etc using collections is a post from: Eswar Koneti's Blog