v_r_user and v_gs_computer_system

select
—    U.ExtensionAttribute50 As ‘Dept #’,
    isnull(U.Department0,’Unknown’) As ‘Dept Name’,
    isnull(CS.Name0,’Unknown’) as ‘client Id’,
    max(AD.AgentTime) as ‘Last Heartbeat’
from
    dbo.v_AgentDiscoveries ad
    JOIN dbo.v_GS_COMPUTER_SYSTEM cs on AD.ResourceID = CS.ResourceId
    join dbo.v_FullCollectionMembership FCM on FCM.ResourceID = CS.ResourceId
    Left outer join dbo.V_R_user U ON U.Unique_User_Name0 = CS.UserName0

Where
    AD.AgentName = ‘Heartbeat Discovery’
    and FCM.CollectionID = ‘SMS00001’
Group by
—    U.ExtensionAttribute50,
    isnull(U.Department0,’Unknown’),
    isnull(CS.Name0,’Unknown’)

Leave a Reply

Your email address will not be published. Required fields are marked *