Exporting CRM security roles and permissions.

Sep 23, 2015 at 12:33 AM
Hi,

I've downloaded the latest version to export the security roles and permission levels into an excel file. I'm unable to connect to the CRM 2015 Online environment. I'm not the admin for the O365 environment, but I'm a CRM admin within the application.

I've tried to log in via the Online and O365 options, but keep getting an error and can't generate the log file.

Any help would be greatly appreciated.

Regards,
Ed
Coordinator
Nov 30, 2015 at 5:00 PM
Hi Ed,

This is fixed. Please download the latest release now, and try. Do let me know if you still have any issues.

Thanks,
John
Marked as answer by Johninfant on 12/2/2015 at 1:44 AM
Jan 13, 2016 at 2:29 AM
Edited Jan 13, 2016 at 4:05 AM
hi John,

I used your tool today to export Security Roles from my CRM 2011 OnPremise Instance. I got Connected to CRM through your tool without any issues. But when i try to export the selected security roles, your applications gets close automatically. ! Do you have any idea ?


Getting the following error in EventLog.

Application: RoleSheetExporter.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at RoleSheetExporter.MainWindow.<orgParameteredCallBack>b__6(Microsoft.Xrm.Sdk.Metadata.EntityMetadata)
at System.Linq.Enumerable+WhereArrayIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at RoleSheetExporter.MainWindow.orgParameteredCallBack(Microsoft.Xrm.Sdk.OrganizationResponse, System.Object)
at AsyncServices.AsyncService.newOrgWorker_RunWorkerCompleted(System.Object, System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(System.ComponentModel.RunWorkerCompletedEventArgs)
at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at RoleSheetExporter.App.Main()
Jan 13, 2016 at 11:51 AM
Same error from my end

Thanks
Charmaine
Jan 13, 2016 at 12:02 PM
I also noticed that it crashes whenever i have custom built roles under the BU. For a clean installation with no custom roles it works fine if that helps.
Coordinator
Jan 13, 2016 at 1:27 PM
Hi Charmaine/Awad,

In the tool ribbon --> Metadata tab, does clicking on refresh metadata help? The metadata for the instance you connected before will be cached, to reduce the time take to load the application. When you connect to an organization, the org's metadata will be loaded from cache.
Jan 13, 2016 at 8:35 PM
Edited Jan 13, 2016 at 9:06 PM
Hi John,

Though Metadata is cached , the tool got crashed with the same error. I think the problem is with your latest version.

I tried RoleExporter V3.0, it works perfectly fine on my machine. but v3.2 is getting crashed.
Jan 14, 2016 at 7:37 AM
Hi John,

Same with me i have tried refreshing meta data in the new version but to no avail. I just tried downloading version 3.0 and this is working fine
Coordinator
Jan 25, 2016 at 3:18 PM
Hi Awad/Charmaine,

Sorry for the delay. Got held up at work.

I am still not able to recreate the issue. :( I tried creating an custom entity and a custom security role. :( Still cannot figure out where the issue occurs. I have added a try catch, in the area I suspect, and I have attached the PDB file. Please let me know if you can get the line number/privilege name from the tool console.

Thanks,
John
Coordinator
Apr 6, 2016 at 8:59 AM
Hi Awad, Charmaine,

Sorry for the delay guys. My laptop crashed, and I lost the code.

I have just uploaded a new version, and I hope this issue is fixed in this version. Please let me know if you face the issue again.

Thanks for reporting.

Regards,
John