SCCM2012 Computer, Last logon user, Last console use

Does anyone know of a report query that will get me: 

Computer, Last logon user, Last console use ?

August 27th, 2015 7:21pm

I found this and it gives me what i need, but it limits it to i think the top users. I want it for all systems.

Select distinct 
v_R_System.Netbios_Name0 AS "Computer Name",
v_GS_SYSTEM_CONSOLE_USER.SystemConsoleUser0 AS "Console User",
v_GS_SYSTEM_CONSOLE_USER.NumberOfConsoleLogons0 AS "Console Logons",
v_GS_SYSTEM_CONSOLE_USER.TotalUserConsoleMinutes0 AS "Total Minutes on Console",
v_GS_SYSTEM_CONSOLE_USER.LastConsoleUse0 AS "Last Console Use"
from v_R_System INNER JOIN
(SELECT
ResourceID,
SystemConsoleUser0,
NumberOfConsoleLogons0,
TotalUserConsoleMinutes0,
LastConsoleUse0,
ROW_NUMBER() OVER(PARTITION BY ResourceID ORDER BY LastConsoleUse0 DESC) AS Point
FROM
v_GS_SYSTEM_CONSOLE_USER) v_GS_SYSTEM_CONSOLE_USER
ON v_GS_SYSTEM_CONSOLE_USER.ResourceID = v_R_System.ResourceID
AND v_GS_SYSTEM_CONSOLE_USER.Point = 1
Order by v_R_System.Netbios_Name0

Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 7:29pm

Checkout this function will list the last user logged on or logged in - Get-LastLogon

Also have a look on this earlier discussed thread for Last Console Use

If you wish, you may also test this automated solution i.e. Last Logon Reporter which lets you to accomplish this task automatically.

Hope it helps you!

August 28th, 2015 12:59am

Hi,

Please check the query below.

select v_R_System.Netbios_Name0 As "Computer Name",v_GS_SYSTEM_CONSOLE_USER.SystemConsoleUser0 As "Console User",v_GS_SYSTEM_CONSOLE_USER.LastConsoleUse0 As "Last Console Use"
from v_GS_SYSTEM_CONSOLE_USER 
inner join v_R_System on v_GS_SYSTEM_CONSOLE_USER.ResourceID=v_R_System.ResourceID

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 5:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics