Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

User Roles Export

(0) ShareShare
ReportReport
Posted on by 190

Hello,

I want to export an excel file/file which can show the security roles of each user we currently have. Is it possible to do this in an efficient way instead of clicking into each individual user and taking down what roles they possess?

Any help would be greatly appreciated.

Thank you in advance.

  • jork Profile Picture
    jork 12 on at
    User Roles Export
    If you have access the backend via SSMS (connecting via Azure Active Directory - Universal with MFA), the below SQL script is what I use for exporting active users with their roles:
     
    SELECT
        U.SystemUserId,
        U.FullName,
        U.AccessModeName,
        U.DomainName,
        U.InternalEmailAddress,
        U.Title,
        RC.UserRoleCount,
        STUFF((SELECT DISTINCT '; ' + R.Name
                FROM systemuserroles SUR INNER JOIN role R ON R.roleid = SUR.roleid
                WHERE SUR.systemuserid = U.systemuserid
                For XML Path('')), 1, 2,'') AS AssignedSecurityRoles
    FROM
        systemuser U
        LEFT JOIN (SELECT SystemUserId, COUNT(1) AS UserRoleCount FROM systemuserroles GROUP BY SystemUserId) RC ON RC.systemuserid = U.systemuserid
    WHERE
        U.IsDisabled = 0
        --AND U.fullname NOT LIKE '#%'
        --AND RC.UserRoleCount > 0
    ORDER BY
        U.Fullname    
  • Suggested answer
    Ysondh Profile Picture
    Ysondh 5 on at
    RE: User Roles Export

    Great read and very helpful. Thanks alot.

    [quote user="dynamicsgs"]

    Hello,

    I want to export an excel file/file which can show the security roles of each user we currently have. Is it possible to do this in an efficient way instead of clicking into each individual user and taking down what roles they possess?

    Any help would be greatly appreciated.

    Thank you in advance.

    [/quote]

    [quote user="dynamicsgs"]

    Hello,

    I want to export an excel file/file which can show the security roles of each user we currently have. Is it possible to do this in an efficient way instead of clicking into each individual user and taking down what roles they possess?

    Any help would be greatly appreciated.

    Thank you in advance.

    [/quote]

    [quote user="dynamicsgs"]

    Hello,

    I want to export an excel file/file which can show the security roles of each user we currently have. Is it possible to do this in an efficient way instead of clicking into each individual user and taking down what roles they possess?

    Any help would be greatly appreciated.

    Thank you in advance.

    [/quote]
  • technology101010 Profile Picture
    technology101010 35 on at
    RE: User Roles Export

    Hello,

    This is very helpful. Is there any way to filter the users who used a specific entity like for example Leads?

    Thanks!

    Tech101010

  • dynamicsgs Profile Picture
    dynamicsgs 190 on at
    RE: User Roles Export

    Hi Lu,

    This is a great help. Thank you so much. 

  • Verified answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: User Roles Export

    Hi partner,

    Basically, there are two ways.

    1. We can use OOTB report to export Excel.

    Open Advanced Find, Look for Reports, set condition: Name Equals "User Summary", click Results.

    pastedimage1583292084641v1.png

    Open the report.

    pastedimage1583292115989v2.png

    Select the user scope and click Run Report.

    pastedimage1583292164435v3.png

    You will see the security roles of all users. Then save as Excel.

    pastedimage1583292251194v6.png    pastedimage1583292288118v7.png

    This report, however, does not show the security roles directly in one column, but rather many columns in which each user corresponds to his or her security role.

    So if you want to display security roles directly in one column, you need to use XrmToolBox's "Users, Team and Security Role Report" tool.

    2. XrmToolBox's "Users, Team and Security Role Report" tool

    This is the download page for XrmToolBox: https://www.xrmtoolbox.com/

    After downloading and unzipping it, open XrmToolBox.exe.

    Connect to your D365 organization. Install "Users, Team and Security Role Report" in the tool library.

    Open the tool and click Load Data, then click Generate Report. It will download two files, one is .csv and one is .xlsx.

    Use Notepad to open the .csv file and copy all. Then open the .xlsx file and paste the data in the first worksheet.

    The effect is as follows:

    pastedimage1583294188214v8.png

  • Verified answer
    Gary Letter Profile Picture
    Gary Letter 1,267 on at
    RE: User Roles Export

    Hi dynamicsgs,

    In the Reports area, you can run the User Summary report to show all the security roles assigned to each user.

    Gary Letter
    NextLevel Business Systems

    If you find the answer useful, please click "Yes" to mark it as verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans