PCs with the no logon information for 30 days

Published Wednesday, August 27, 2008 9:26 AM

SELECT distinct
CS.Name0 AS 'Computer',
isnull(CS.UserName0,HCS.UserName0) AS 'User Name' ,
CS.TimeStamp
FROM
v_GS_COMPUTER_SYSTEM CS Left outer join v_HS_COMPUTER_SYSTEM HCS on CS.ResourceID = HCS.ResourceID
WHERE
HCS.UserName0 is not NULL
and datediff(dd,CS.TimeStamp,getdate()) > 30
Group by
CS.Name0,
CS.UserName0,
CS.TimeStamp,
HCS.UserName0
order by
CS.Name0

Read the complete post at http://smsug.ca/blogs/garth_jones/archive/2008/08/27/pcs-with-the-no-logon-information-for-30-days.aspx

Filed under: , , ,