Show Computers by Location with Asset
Updated: 10 Sep 2008 | 1 comment
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
blog entry Filed Under:

The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
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.