One possibility.  Note that, at least in my world, being a laptop doesn't 
necessarily mean you don't happen to have a Server OS installed on it 
anyway--so those are two separate things to me. User can be ambigious as well.  
I went with "last activity" from the client health summary--but what means last 
activity date can mean different things to different people, too.  
;with islaptop as
(select case when se.ChassisTypes0 in ('8','9','10','11','12','14','18''21') 
then 1
else 0 end as islaptop,
se.resourceid
from v_GS_SYSTEM_ENCLOSURE se
)select sys.Netbios_Name0, sys.User_Name0 [User According to Heartbeat]
,consoleuser.SystemConsoleUser0 [User according to Console Usage]
, islaptop.islaptop
,case when sys.Operating_System_Name_and0 like '%server%' then 'Server'
when sys.Operating_system_Name_and0 like '%workstation%' then 'Workstation'
else sys.Operating_System_Name_and0 end as 'server or workstation'
,cs.LastActiveTime
from v_r_system sys
left join islaptop on islaptop.resourceid=sys.resourceid
left join v_GS_SYSTEM_CONSOLE_USER consoleuser on 
consoleuser.ResourceID=sys.ResourceID
left join v_CH_ClientSummary CS on cs.resourceid=sys.resourceid 
 


     On Tuesday, April 7, 2015 6:49 AM, Radu Bogdan <[email protected]> 
wrote:
   

 Hello, Does any one know how to create a custom report with the following 
columns: Computer name, Type ( servers, desktops or laptops ), User name, Last 
activity date. Thank you. Regards.  


  


Reply via email to