Tuesday, 2 February 2016

Check user last login time when user last accessed CRM

http://mscrm-chandan.blogspot.co.uk/2013/04/get-last-log-in-datetime-of-crm-user_30.html

SELECT
 SU.SystemUserId
 ,SU.DomainName
 ,SU.FullName
 ,SUO.LastAccessTime
 FROM SystemUser SU
 INNER JOIN [MSCRM_CONFIG].[dbo].[SystemUserOrganizations] SUO ON SUO.CrmUserId = SU.SystemUserId
 INNER JOIN [MSCRM_CONFIG].[dbo].[SystemUserAuthentication] SUA ON SUA.UserId = SUO.UserId
 ORDER BY SUO.LastAccessTime DESC,SU.DomainName

No comments:

Post a Comment