For full details see. http://social.technet.microsoft.com/Forums/en-US/configmgrsdk/thread/cf7d80a0-1a7c-430c-b33a-ee47a0efa806
selectCS.Name0,LCU.dateFromdbo.v_GS_COMPUTER_SYSTEM CSjoin ( SelectResourceID,max(LastConsoleUse0) as 'date'
fromdbo.v_GS_SYSTEM_CONSOLE_USER SCUGroup byResourceID) as LCU on CS.ResourceID = LCU.ResourceIDWheredatediff(dd,LCU.date,getdate()) >14