Useful CRM Tips

Useful CRM Tips...

Monday, March 24, 2014

SQL Script which gives the list of users who never logged into CRM

Below is the SQL Script which gives the list of users who never logged into CRM with given Organisation DB.


Use MSCRM_CONFIG

SELECT

O.FriendlyName as Organization, SUO.LastAccessTime, U.FirstName, U.LastName, U.FullName

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

Inner Join standard_MSCRM.dbo.SystemUser U On  SUO.CrmUserId = U.SystemUserId

WHERE

LastAccessTime Is Null