Does anyone know of a report query that will get me:
Computer, Last logon user, Last console use ?
Technology Tips and News
Does anyone know of a report query that will get me:
Computer, Last logon user, Last console use ?
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
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!
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