How to get LastActivityDate when using Active Directory Setup in a .net application

961 Views Asked by At

I have a requirement to show a list of all users along with the Last Activity Date. The application is .Net based.

I found the MemberShip class provides the Last Activity date. However, this does not work when the MemberShip provider is ActiveDirectory Link to MSDN page because the ActiveDirectoryMemberShipUser does not implement the LastActivityDate property.

Is there any workaround or other way, I can get the LastActivityDate of the user in the application.

Thanks for any info

1

There are 1 best solutions below

2
On

The problem is that the AD does not maintain an accurate last logon time stamp so determining the last activity would require searching through the domain controllers Security Eventlog.

http://blogs.technet.com/askds/archive/2009/04/15/the-lastlogontimestamp-attribute-what-it-was-designed-for-and-how-it-works.aspx