For full details see. http://social.technet.microsoft.com/Forums/en-US/configmgrsdk/thread/cf7d80a0-1a7c-430c-b33a-ee47a0efa806
select
CS.Name0,
LCU.date
From
dbo.v_GS_COMPUTER_SYSTEM CS
join ( Select
ResourceID,
max(LastConsoleUse0) as 'date'
from
dbo.v_GS_SYSTEM_CONSOLE_USER SCU
Group by
ResourceID) as LCU on CS.ResourceID = LCU.ResourceID
Where
datediff(dd,LCU.date,getdate()) >14