Thursday, 27 September 2018

Dynamics CRM : Export Security Role

In CRM as a developer sometime we need to see permission given to Security role.
Dynamics CRM/365 we need to open security role to check permission in that security role.
But there is no provision to export Security role permission.

Case Study: -
Developer X is working in an organization as support engineer. He was not part of implementation team.
User requested role given in each security role permission in excel sheet.
It is time consuming job to open each security role and make excel sheet manually with all permission.

Solution: -
To tackle this case study, I have created a XrmToolBox Plugin which help Developer X.
User can see permission given in each security role to entity.
User can see Miscellaneous Privileges.
User can export all Privileges based on selected Security role.
Download XRMToolBox from given URL and install.
Install “Export Security Role” Plugin in your XRMTollBox using plugin store.

If you are not able to find “Export Security Role.
Go to given link.

Download Plugin

And download plugin from here. Install in XRMToolBox by clicking Settings->Path->Storage folder->Plugin folder.
Copy assemblies in Plugin folder.

Connect your organization and open plugin Export Security Role.

Click on “Retrieve Roles” and select your security Role.
Now you will see list of all security roles in role list.

Now when you select any security role it will show all Privileges for selected security role.

If need to search specific entity enter logical name in search box.

Click on Export button to export privileges in excel.

As a result, you will see a excel file with Security role name is create with all privileges.

Now Developer X will easily able to find and share permission based on security role.

Note: - Plugin based on .net framework 4.5.2. Microsoft office required to export result.

Follow my blog so you will not miss my new upcoming blogs.


  1. I like that the visibility to Teams and Users that the security role is assigned to are shown. However, just clicking on a Business Unit and a Security Role did not show any of the permissions on the screen as shown in your explanation. What did I miss?

  2. Hey Santosh thank you for your effort! I did experience the same thing. All permissions are either set as "None" or "Organization", with no "Business Unit" or "User" or "Parent: Child Business Units" values.

    1. Hi Hani,
      Thanks for reply.
      I have verified your reply and I can see other permission also like "user", "business unit". Try with other security role.
      Miscellaneous privileges can be organization only.

  3. Hi Santosh, even i faced the same issue, either its organization or none, other privileges are not showing up.

    1. Issue is fixed now and latest code in avaliable in given link.
      Please try and share your comment.

  4. Hi Santosh, I'm not able to get the plugin to show up in the xrmtoolbox store. Is it still publsihed? If so, do you have more instructions how to add it?

    1. Hi Bassio,
      I think xrmtoolbox yet not verifed plugin. I have shared plugin source in download link
      You can download and add in your plugin folder.

  5. Great work but when i export the roles, i only get "None" or "Organization". Not the others. Is it possible to fix?

    1. Issue is fixed now and latest code in avaliable in given link.
      Please try and share your comment.

  6. Hi Folks,

    Issue is fixed now and latest code in avaliable in given link.
    Please try and share your comment.

  7. Looking for custom CRM software development company? Try our CRM services! Augurs provide a wide range of custom CRM development services tailored to the industry-specific requirements.

  8. When i try to export is showing this error: Is not working, Helppppp please

    System.Runtime.InteropServices.COMException (0x8002000B): El índice no es válido. (Excepción de HRESULT: 0x8002000B (DISP_E_BADINDEX))
    en Microsoft.Office.Interop.Excel.Sheets.get__Default(Object Index)
    en ExportSecurityRole.ExportRole.btn_Export_Click(Object sender, EventArgs e)
    en System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
    en System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
    en System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
    en System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
    en System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
    en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    en System.Windows.Forms.Control.WndProc(Message& m)
    en System.Windows.Forms.ToolStrip.WndProc(Message& m)
    en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    1. Make sure you have installed Microsoft office 365. and try again.

    2. Nice, i have a question, Should I have Office 365 installed offline

  9. Nice Blog! Sharing a good information and Any information to Microsoft-Based ERP Solution is specialized to help companies obtain reports and business analysis, while helping increase efficiency, accuracy, and customer satisfaction. By enabling you to automate and streamline projects across company divisions and locations, Microsoft Dynamics Solution helps you manage people, projects, and profitability. For more information to visit our website:-

  10. When I try to export is showing this error, could you help me please

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.Runtime.InteropServices.COMException (0x8002000B): Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
    at Microsoft.Office.Interop.Excel.Sheets.get__Default(Object Index)
    at ExportSecurityRole.ExportRole.btn_Export_Click(Object sender, EventArgs e)
    at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
    at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
    at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ToolStrip.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  11. I'm getting this erros
    Ocorreu uma exceção sem tratamento no aplicativo. Se você clicar em Continuar, o aplicativo ignorará esse erro e tentará continuar. Se clicar em Encerrar, o aplicativo será encerrado imediatamente.

    Índice inválido. (Exceção de HRESULT: 0x8002000B (DISP_E_BADINDEX)).
    Consulte o final desta mensagem para obter detalhes sobre como chamar a
    depuração just-in-time (JIT) em vez desta caixa de diálogo.

  12. Very nice services provided by you. Thank you for imparting this useful information here. Website Designing Companies in Bangalore | Web Design Agency in Bangalore | Web Design Services in Bangalore


Dynamics Portal-Note Required Based On Quick View Form Value

Microsoft Dynamics Portal provides capability to allow login customers without needed any license. Here I am not explaining benefits of D...