Computer Name and User Name

Nagesh A S
Nagesh A S used Ask the Experts™
on
I am using SCCM 2012 R2 in my infrastructure. I would like to know how to get computer name and logged user name and last log on time. There are multiple queries and I tried to pull the report, how ever it is not consistence and the report has lot of discrepancies in connection to log on time stamp.
Is there something specifically needs to be enable for this in SCCM
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015
Commented:
I just tested this one and it Works for me.

------------------------
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
--------------------------------
Nagesh A SSCCM Administrator

Author

Commented:
this requires to enable log on Audit in the security and I could able to get the details.  thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial