Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
The below SQL query is useful to find out the Security Roles assigned to the users from backend by querying the Organization_MSCRM database in SQL Server.
select role.name as 'Role Name',
cast(systemuser.systemuserid as nvarchar(50)) as 'System User Id',
fullname as 'Full Name',
domainname as 'Domain Name',
firstname as 'First Name',
lastname as 'Last Name',
internalemailaddress as 'Mail ID',
isdisabledname as 'Status',systemuser.businessunitidname as 'Business Unit', systemuser.businessunitid as 'Business Unit ID'
from Filteredsystemuser AS systemuser
LEFT JOIN FilteredSystemUserRoles AS userroles on systemuser.systemuserid = userroles.systemuserid
LEFT JOIN FilteredRole AS role on role.roleid = userroles.roleid
where domainname is not null
This shall return only the roles which are directly associated to the user. slightly modified the query to retrieve the role which are inherited by the team membership.
This returns the same output of Xrm.Page.context.getUserRoles()
INNER JOIN FilteredTeamMembership AS teammember on teammember.systemuserid=systemuser.systemuserid
INNER JOIN FilteredTeamRoles AS teamroles on teamroles.teamid=teammember.teamid
INNER JOIN FilteredRole AS role on role.roleid = teamroles.roleid
order by domainname
Business Applications communities