Show Computers by Location with Asset

Show Computers by Location with Asset
robertser's picture

Great view to have in your Asset database for reporting the locations your PCs are at. With this view you can easily add a Location column with address to any report you have.

Copy the below code into you Altiris database and save it as a view. I would recommend naming it something easy like vwCSTM_PC_to_Location.

SELECT DISTINCT vc.Guid, vc.Name, vl.Name AS Location, vl.Address, vl.City, vl.State, vl.Zip, vl.Country, vsi.Name AS SiteCode
FROM     dbo.vComputer AS vc INNER JOIN
           dbo.ResourceAssociation AS vcra ON vcra.ParentResourceGuid = vc.Guid INNER JOIN
           dbo.vLocation AS vl ON vcra.ChildResourceGuid = vl._ResourceGuid INNER JOIN
           dbo.ResourceAssociation AS sura ON sura.ParentResourceGuid = vl._ResourceGuid INNER JOIN
           dbo.vSubnet AS vsu ON vsu.Guid = sura.ChildResourceGuid INNER JOIN
           dbo.ResourceAssociation AS sira ON sira.ChildResourceGuid = vsu.Guid INNER JOIN
           dbo.vSite AS vsi ON vsi.Guid = sira.ParentResourceGuid
           
4.09091
Average: 4.1 (22 votes)