none
check which users login a sharepoint site during the past 30 days? and what's the last login time? RRS feed

  • Question

  • Hi Everyone,

    How to check which users login a sharepoint site during the past 30 days? and what's the last login time?

    Please help me me how to solve this problem.

    Thanks


    Hari

    Monday, January 12, 2015 10:21 PM

Answers

  • To my knowledge there is no direct way to retrieve this easily. Enabling Audit logs is not a good call as it creates a lot of data for nothing, and particularly it is per Site Collection, which leaves the question : "do you enable this for all site collections?" - you are in for a tremendous amount of information - weight that carefully.

    In the past we've used 2 approaches:

    For SharePoint foundation we've build a simple HttpModule which does nothing else but recording some information we wanted to track user behaviour across many sites, etc.
    For SharePoint Standard and beyond, we used custom properties (which user could not change) and stored that in his User profile directly (SharePoint API is quite rich in this direction)


    there is no direct way to determine user logout event (because there are many possible scenarios when user may go way from your site without clicking on logout button - and his authentication cookies will be expired, so technically he will be logged out but without particular event). Check this forum thread: I need to log out of the application when user closes the browser of a sharepoint 2007 internet website . It contains some useful info about this question.

    Determining of login event is possible - however it depends on authentication type you use: FBA or NTLM. If you use FBA - you need to customize standard ASP.Net Login control and handle itsLoggedIn event. If you use NTLM authentication - try to use http modules and handleAuthenticateRequest event of web application. Hope it will give you the direction.



    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

    Tuesday, January 13, 2015 12:44 AM

All replies

  • To my knowledge there is no direct way to retrieve this easily. Enabling Audit logs is not a good call as it creates a lot of data for nothing, and particularly it is per Site Collection, which leaves the question : "do you enable this for all site collections?" - you are in for a tremendous amount of information - weight that carefully.

    In the past we've used 2 approaches:

    For SharePoint foundation we've build a simple HttpModule which does nothing else but recording some information we wanted to track user behaviour across many sites, etc.
    For SharePoint Standard and beyond, we used custom properties (which user could not change) and stored that in his User profile directly (SharePoint API is quite rich in this direction)


    there is no direct way to determine user logout event (because there are many possible scenarios when user may go way from your site without clicking on logout button - and his authentication cookies will be expired, so technically he will be logged out but without particular event). Check this forum thread: I need to log out of the application when user closes the browser of a sharepoint 2007 internet website . It contains some useful info about this question.

    Determining of login event is possible - however it depends on authentication type you use: FBA or NTLM. If you use FBA - you need to customize standard ASP.Net Login control and handle itsLoggedIn event. If you use NTLM authentication - try to use http modules and handleAuthenticateRequest event of web application. Hope it will give you the direction.



    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

    Tuesday, January 13, 2015 12:44 AM
  • try this link:

    http://www.go4sharepoint.com/Forum/programmatically-get-last-login-time-11376.aspx

    https://social.technet.microsoft.com/forums/sharepoint/en-US/231945e3-f149-4d82-b2b1-3cc89868cca7/get-last-login-time-of-user-on-sharepoint-2010

    http://sharepoint.stackexchange.com/questions/62104/getting-spuser-last-login-date-time

    http://sharepoint.stackexchange.com/questions/74598/powershell-to-view-last-login-date-for-users

    http://stackoverflow.com/questions/16071458/get-user-last-login-time-on-sharepoint

    Tuesday, January 13, 2015 2:02 PM