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.
Install “Export
Security Role” Plugin in your XRMTollBox using plugin store.
If you are not able to find “Export Security Role” in Xrmtoolbox.
Use below links
Download Plugin compatible with Xrmtoolbox Version 1.2019.7.34 from here:
Download 1.2019.11.15
Download Xrmtoolbox Version 1.2019.7.34 from here:
XrmToolbox v1.2019.7.34
Download 1.2019.11.15
Download Xrmtoolbox Version 1.2019.7.34 from here:
XrmToolbox v1.2019.7.34
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.
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?
ReplyDeleteHey 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.
ReplyDeleteHi Hani,
DeleteThanks 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.
Hi Santosh, even i faced the same issue, either its organization or none, other privileges are not showing up.
ReplyDeleteIssue is fixed now and latest code in avaliable in given link.
DeletePlease try and share your comment.
https://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
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?
ReplyDeleteHi Bassio,
DeleteI think xrmtoolbox yet not verifed plugin. I have shared plugin source in download link https://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
You can download and add in your plugin folder.
Hi Santosh,
DeleteAfter downloading the Assembly file and added dll in plugin folder, i am not able to find plugin in the store to install. Export security role plugin is not available in the list
Once you add plugin folder you should able to see this plugin in your list of plugins.
DeleteUse below link to get updated plugin
https://github.com/santoshCRM/Export-Security-Role/blob/master/Savants.ExportSecurityRole%20v1.2019.11.15.zip
This plugin compatible with xrmtoolbox version 1.2019.7.34
Hi Folks,
ReplyDeleteIssue is fixed now and latest code in avaliable in given link.
Please try and share your comment.
https://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
Issue is fixed now and latest code in avaliable in given link.
ReplyDeletePlease try and share your comment.
https://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
When i try to export is showing this error: Is not working, Helppppp please
ReplyDeleteSystem.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)
Make sure you have installed Microsoft office 365. and try again.
DeleteNice, i have a question, Should I have Office 365 installed offline
DeleteYes, Or you can download zip file from
Deletehttps://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
It have required office DLL
When I try to export is showing this error, could you help me please
ReplyDeleteSee 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)
I Get the same error.
Deleteyou can download zip file from
Deletehttps://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
It have required office DLL
I'm getting this erros
ReplyDeleteOcorreu 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.
you can download zip file from
Deletehttps://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
It have required office DLL
Hi Santosh, i am getting below error while retrieving the roles.
ReplyDeleteUnable to cast object of type 'Microsoft.Xrm.Tooling.Connector.CrmServiceClient' to type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy'.
It seems you are not using updated XRMToolbox.
DeleteUpdate your Xrmtoolbox and
you can download zip file from
https://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
It have required office DLL
I am using the updated Xrmtoolbox but still getting the same error.I tried downloading the zip file you said above and added those dll's from the assembly folder to XRM tool box extracted folder, still no luck. Please assist.
DeleteHi Santosh, This error is resolved but another error occurring for one of the custom Entity
ReplyDelete"An error occurred: An error occurred while parsing EntityName. Line 1, position 302."
you can download zip file from
ReplyDeletehttps://github.com/santoshCRM/Export-Security-Role/blob/master/Assembly.zip
It have required office DLL
Can you try with Trail instance first for more comparison.
Hi Santosh, I´m getting an error retrieving roles with your Export Security Role:
ReplyDeleteSee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'Microsoft.Xrm.Tooling.Connector.CrmServiceClient' to type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy'.
at ExportSecurityRole.Helper.createConn(IOrganizationService Service)
at ExportSecurityRole.ExportRole.btn_retRole_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
Use Xrmtool box version XrmToolBox v1.2019.2.32
DeleteDownload from :- https://www.xrmtoolbox.com/releases/
Hi, im having the same problem as guys above me.
ReplyDeleteUnable to cast object of type 'Microsoft.Xrm.Tooling.Connector.CrmServiceClient' to type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy'.
Can you help us, please?
Use Xrmtool box version XrmToolBox v1.2019.2.32
DeleteDownload from :- https://www.xrmtoolbox.com/releases/
Use Xrmtool box version XrmToolBox v1.2019.2.32
ReplyDeleteDownload from :- https://www.xrmtoolbox.com/releases/
i get this error when hit "retrieve roles"
ReplyDeleteSee the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'Microsoft.Xrm.Tooling.Connector.CrmServiceClient' to type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy'.
at ExportSecurityRole.Helper.createConn(IOrganizationService Service)
at ExportSecurityRole.ExportRole.btn_retRole_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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.3416.0 built by: NET472REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
WHAT SHOULD I DO WITH THE OFFICE FILE?
Hello, so the latest release of XRMTB (currently 1.2019.7.34) wont work?
ReplyDeleteNo, it this need to update plugin. will update once get some time.
DeleteHi XrmToolBox v1.2019.2.32 is no longer available for download.
ReplyDeleteWith version 1.2019.7.34 I am getting the same error.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'Microsoft.Xrm.Tooling.Connector.CrmServiceClient' to type 'Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy'.
at ExportSecurityRole.Helper.createConn(IOrganizationService Service)
at ExportSecurityRole.ExportRole.btn_retRole_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)
Hi Mate, I followed your steps and when I clicked on the Retrive Roles, I got the assembly error.
ReplyDelete
Deleteat ExportSecurityRole.Helper.createConn(IOrganizationService Service)
at ExportSecurityRole.ExportRole.btn_retRole_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)
Use below link to get updated plugin
Deletehttps://github.com/santoshCRM/Export-Security-Role/blob/master/Savants.ExportSecurityRole%20v1.2019.11.15.zip
This plugin compatible with xrmtoolbox version 1.2019.7.34
Hi Santosh, thank you so much for this great and helpful tool. Would really appreciate it if you'll consider adding the Entity Display Name in the future. :)
ReplyDeleteThanks for recommendations, This feature enable now
DeleteAre there known issues with the latest Microsoft 365 Apps for Enterprise (Office 365 Excel). Every time I try to export, I get a text file stating "Error occured while exporting security role, Close all excel sheets and try again"
ReplyDeleteAre there aby solution for these error messages:
ReplyDeleteWarning Settings not fountd => a new settings file has been created!
Error Error occured while exporting security role, Close all excel sheets and try again.
Hi Santosh,
ReplyDeleteGreat app but i'm running with above mentioned error
"2021-02-12 05:02:03.489 CRM Test Error Error occured while exporting security role, Close all excel sheets and try again"
Did i something wrong or do you have a solution for this?
Regards
New plugin release for same. Use Role Documenter now.
DeleteHi Santosh, great job on the Role Documenter tool!
ReplyDeleteUnfortunately it seems that, when I create an export, a few privileges are missing. For a custom role I created there are some privileges under the Business Mgmt and Service tab that are not in the export file.
Is there a known bug?
Thanks!
Timothy