IT Management Suite

 View Only
  • 1.  SQL query for last logged-in users on a particular machines in domain

    Posted Feb 17, 2014 07:58 AM

    Hello,

    I want a report to know that how many users logged in a particular machine(Hostname) in domain.

    I also want to know that when that user was created & When that user lastly modified that computer with date & time.

    Regards,

    Thanks in advance,

    Krunal



  • 2.  RE: SQL query for last logged-in users on a particular machines in domain

    Posted Feb 18, 2014 03:26 AM

    Hi, Krunal:

    Here you have a query for finding the last login for every user in every machine in your database:

    SELECT T0.[Name] AS 'Machine Name', T1.[User] AS 'User', max(T1.[Time]) AS 'Login Time'

    FROM [vResourceEx] T0

    INNER JOIN [Evt_AeX_Client_LogOn] T1 ON T0.[Guid] = T1.[_ResourceGuid]

    WHERE T1.[User] like '%%' AND t0.[name] like '%%'

    group by T0.[Guid],T0.[Name],T1.[User]

    order by T0.[Name], max(T1.[Time]) desc

     

    You can filter by the user and/machine if you need to restrict your search by changing the WHERE clause ;)

    As per when the user was created, I guess you should import this information from the Active Directory, as no all the users in the domain may have access to the SMP. I'm afriad I cannot help you with this part of the information you require.



  • 3.  RE: SQL query for last logged-in users on a particular machines in domain