Computers, IP and MAC’s in a specific collection

SELECT Distinct 
    v.Name,
    CASE WHEN v.ResourceType = 3 THEN ‘*’ ELSE ” END as C066,
    CASE WHEN v.ResourceType = 4 THEN ‘*’ ELSE ” END as C067,
    CASE WHEN v.ResourceType = 5 THEN ‘*’ ELSE ” END as C068,
    v.SiteCode,
    CASE IsDirect
        WHEN 1 THEN ‘*’
        WHEN 0 THEN ”
    END AS C069,
    vrs.User_Name0,
    MAC.MAC_Addresses0
FROM
    v_FullCollectionMembership v
    join dbo.v_R_System vrs on v.ResourceID=vrs.ResourceID
    Join dbo.v_RA_System_MACAddresses MAC on MAC.ResourceID=vrs.ResourceID
WHERE
    CollectionID = @ID

Leave a Reply

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