Discover your Site Discovery Methods for SCCM Clients

Had to troubleshoot various client issues today with regard to discovery methods and this query came in handy. You can run this against the primary site SQL database to find out the discovery methods (i.e. AD System discovery, heartbeart etc) that are being found by a specific client in SCCM 2007.

select ssaa.SMS_Assigned_Sites0,
sd.Itemkey, sd.name0, sd.SMS_Unique_Identifier0, sd.client0, sd.client_Type0,
dia.AgentSite, dia.AgentTime,
from system_disc as sd
join discitemagents as dia on
dia.itemkey = sd.itemkey
join agents as a on
dia.Agentid = a.Agentid
join System_SMS_Assign_ARR as ssaa
on ssaa.itemkey = sd.itemkey
where name0 = '<computername>'