Show Computers by Location with Asset
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

your query returning zero results
Robert, can you verify your query? I do not get any results.
Thanks
Would you like to reply?
Login or Register to post your comment.