Views:

Use the following SQL query to find the last time a user logged into CRM:  

Use MSCRM_CONFIG
Select AuthInfo, O.FriendlyName, SUO.LastAccessTime, SU.FullName, SU.FirstName, SU.LastName, SU.BusinessUnitId, SUO.CrmUserId, SUO.OrganizationId
FROM SystemUserOrganizations SUO
LEFT JOIN SystemUserAuthentication SUA ON SUO.UserId = SUA.UserId AND LEFT(AuthInfo, 1)= 'C'
LEFT JOIN Organization O ON SUO.OrganizationId=O.Id
JOIN MLC_MSCRM.dbo.SystemUser SU ON SU.SystemUserId=SUO.CrmUserId AND SU.OrganizationId=SUO.OrganizationId
WHERE LastAccessTime IS NOT NULL
ORDER BY SUO.LastAccessTime DESC