web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Export User Security Roles WITH the associated Modern Business Units

(0) ShareShare
ReportReport
Posted on by
Hi, 
We use Modern Business Units and have a lot of users who are assigned Security Roles across multiple Business Units. 
 
I need to export the users, with each security role, AND the BU associated with that Security Role assignment, and the BU of the user. Something like the mock up below.
 
 
I've used the XRMtoolbox tool titled Users, Teams, and Security Roles, but the output only gives the BU of the User, not the one assigned to the Security Role. 
The User Summary report doesn't seem to provide that detail either. 
 
What are my options?
Any help would be appreciated. 
Thanks
 
 
I have the same question (0)
  • Suggested answer
    Assisted by AI
    Tom_Gioielli Profile Picture
    3,017 Super User 2026 Season 1 on at
    Here is a FetchXML query you can use in FetchXML builder in XRM toolbox. You are needing to query into the systemuserroles intersect table to get all of your results. This query got me the below output. (Note: I used AI to assist in writing the query).
     
     
     
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
      <entity name="systemuser">
        <attribute name="fullname" alias="user_fullname" />
        <attribute name="internalemailaddress" alias="user_email" />
        <attribute name="domainname" alias="user_upn" />
        <attribute name="systemuserid" />
        <!-- Optional: filter to enabled users only -->
        <filter type="and">
          <condition attribute="isdisabled" operator="eq" value="0" />
        </filter>
        <!-- Intersect: systemuser <-> role -->
        <link-entity name="systemuserroles" from="systemuserid" to="systemuserid" intersect="true">
          <link-entity name="role" from="roleid" to="roleid" alias="r">
            <attribute name="name" alias="role_name" />
            <attribute name="roleid" />
            <!-- Role's owning Business Unit -->
            <link-entity name="businessunit" from="businessunitid" to="businessunitid" alias="bu">
              <attribute name="name" alias="role_businessunit_name" />
            </link-entity>
          </link-entity>
        </link-entity>
        <!-- Optional ordering -->
        <order attribute="fullname" />
      </entity>
    </fetch>
     
     
    If this response helped, please consider marking as verified so future users can see the resolution. If you have additional questions or problems, please tag me in the response so I receive a notification.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 49

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 44 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans