Good Day to all, I'm having a little trouble with a report. I'm looking for a report which will provide me a list of computers/ 30 days of inactivity / and the user who last logged in or Primary user of the inactive computer. I know there is a way to email the results, if this is also available it would be a massive bonus.
I've found this in the default Altiris reports but its missing the user portion to it.
Can Someone help? Thanks
DECLARE @v1_TrusteeScope nvarchar(max)
SET @v1_TrusteeScope = N'%TrusteeScope%'
MAX (r.[Collection Time]) [Last Collection Date]
FROM dbo.vComputer i
JOIN dbo.ScopeMembership sm
ON sm.[ResourceGuid] = i.Guid
AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
JOIN dbo.Inv_Inventory_Results r
ON r.[_ResourceGuid] = i.Guid
AND r.Agent = 'Inventory Agent'
JOIN dbo.CollectionMembership cm
ON cm.ResourceGuid = i.Guid
JOIN dbo.vCollection it
ON it.Guid = cm.CollectionGuid
WHERE DATEDIFF(day,r.[Collection Time],GETDATE()) >= %Days%
AND LOWER (i.[Name]) LIKE LOWER ('%ComputerName%')
AND ('%Domain%' = '%' OR i.Domain = '%Domain%')
AND (('%OS Platform%' = 'Windows' AND i.[System Type] LIKE 'Win%')
OR ('%OS Platform%' = 'Unix/Linux' AND i.[System Type] LIKE 'Unix%')
OR ('%OS Platform%' = 'Macintosh' AND i.[System Type] LIKE 'Mac%')
OR ('%OS Platform%' = 'Other' AND i.[System Type] NOT LIKE 'Win%'
AND i.[System Type] NOT LIKE 'Unix%'
AND i.[System Type] NOT LIKE 'Mac%')
OR ('%OS Platform%' = '%'))
AND it.[Guid] = '%Filter%'
GROUP BY i.Guid,i.Name
ORDER BY MAX (r.[Collection Time])