SQL Query to get Users with assigned roles from Dynamics CRM
Views (7997)
Below is the query to get the list of users with their roles from Dynamics CRM.
select us.DomainName, us.fullname, rl.Name
from SystemUser us left join SystemUserRoles usrl on us.SystemUserId = usrl.SystemUserId
inner join Role rl on rl.RoleId = usrl.RoleId
where
us.IsDisabled = 0
order by us.FullName

This was originally posted here.
*This post is locked for comments