Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 2 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
CRM does not seem to provide any methods in the SDK to check if a user has System Administrator privilege’s. One straightforward way to achieve this is to query for a roles associated with the user which has a title of ‘System Administrator’. However this approach has its limitations in a multi-language enabled tenant as the role title would have been defined in a different language, in which case querying for a role with the tile ‘System Administrator’ would not render any results.
Looks like there is a possible undocumented way to get around this limitation.Every OOB CRM role seems to have a ‘Role Template’ associated.So the ‘System Administrator’ role is associated with a role template with the id ‘627090FF-40A3-4053-8790-584EDC5BE201’.This role template id is the same across all tenants and is set when the instance is provisioned.This id can be used to query CRM and get the desired results.Refer sample query below. If the below query returns any record we could safely assume that the user has ‘System Administrator’ privilege.
var roleQuery = new QueryExpression(“role”);roleQuery.Criteria.AddCondition(“roletemplateid”, ConditionOperator.Equal, “627090FF-40A3-4053-8790-584EDC5BE201”);var userRolesLink = roleQuery.AddLink(“systemuserroles”, “roleid”, “roleid”);userRolesLink.LinkCriteria.AddCondition(“systemuserid”, ConditionOperator.Equal, [USER GUID]);_dynamicsService.RetrieveMultiple(roleQuery);
Business Applications communities