Hi need help on the same use case but little more detail. I need users last login time. This is to make sure to remove the users donot need teamsite access any more. Is it possible.
I have gone through iwrecentusers and it is not useful.
Is there any DB table or file on the OS that I can search for this information.
iwrecentusers is what you want, there is no better alternative (you could perhaps check the file times on the user entity files - but that's a lot more work than using iwrecentusers), however you need to pipe its output to a text file* and then manage the list in the text file - eg. update existing users with the latest times, reorder, whatever...
In my case, I have a scheduled job which runs iwrecentusers every 3-4 hours and organises my text file. Then each week I have a scheduled job which checks the file for users that haven't logged into TeamSite in over 3 months.
* iwrecentusers only lists user activity since the last time TeamSite was restarted, which is why you need to run it regularly and store the output in a file.