29. March 2011 12:25
In Microsoft Dynamics CRM 2011 you can get the last login time of a CRM user by using the below query:
SELECT
AuthInfo, O.FriendlyName, SUO.LastAccessTime
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
WHERE
LastAccessTime IS NOT NULL
ORDER BY SUO.LastAccessTime DESC
The query outputs the systemuser name, the organisation name and the date and time of the last login:
| username@exaple.com |
OrganisationName |
2011-03-23 16:36:13.457 |
You can finetune the query to your own wishes.
460014f3-ebb9-4a8b-90f2-7869921b99ff|0|.0
Tags: