How to find the top user for a PC without SMS SP3 or SLAT.

Use this query to help find the top user for a PC. This isn’t fool proof but it should work.

 

SELECT Distinct top 1

            v_GS_COMPUTER_SYSTEM.Name0 as ‘PC Name’,

            isnull(v_HS_COMPUTER_SYSTEM.UserName0,v_GS_COMPUTER_SYSTEM.UserName0) as ‘User Name’,

            Count(isnull(v_HS_COMPUTER_SYSTEM.UserName0,v_GS_COMPUTER_SYSTEM.UserName0)) AS ‘Count’

FROM

            v_GS_COMPUTER_SYSTEM v_GS_COMPUTER_SYSTEM,

            v_HS_COMPUTER_SYSTEM v_HS_COMPUTER_SYSTEM

WHERE

            v_HS_COMPUTER_SYSTEM.ResourceID = v_GS_COMPUTER_SYSTEM.ResourceID

            and v_GS_COMPUTER_SYSTEM.Name0 = ‘Gartek-sms’

GROUP BY

            v_GS_COMPUTER_SYSTEM.Name0,

            v_HS_COMPUTER_SYSTEM.UserName0,

            v_GS_COMPUTER_SYSTEM.UserName0

Order by

            ‘Count’ DESC

Leave a Reply

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