locked
Exporting Security roles in CRM RRS feed

  • Question

  • Hi,

    I am writing some documents and wanted to know if there is a way I can export custom created security roles into a word document or excel sheet please.

    Thanks in advance.

    Tuesday, August 10, 2010 2:51 PM

Answers

  • Hi,

    Faisal means the 'Excel' icon within the view which lists the security roles (settings > administration > security roles). It shows you the names of all the security roles but not much else

    Take a look at this utility http://crm40admin.codeplex.com/ it allows you to export the security role priveliges to a csv file. It isn't pretty but may save you manually creating an Excel sheet from scratch!

    Hope that saves you some time!

    Rob


    CRM4 MBSS
    Tuesday, August 10, 2010 4:51 PM

All replies

  • You can export security roles in Excel but unfortunately it will only export the grid view and I am sure this is not your requirement. It would be easier to create one role on excel sheet and copy it to an other sheet and amend it (one by one).

    Regards

    Faisal

    • Proposed as answer by Faisal Fiaz Wednesday, August 11, 2010 12:43 PM
    Tuesday, August 10, 2010 3:24 PM
  • Thank You Faisal. I think I should be ok with the grid view. Can you please tell me how to do that as I dont see an option for doing it.
    Tuesday, August 10, 2010 4:01 PM
  • If you want to export to Excel as just plain records you can follow below steps:

    1. Go to CRM App -> Settings -> Administration -> Security Roles ->

    2. Select the Roles which you want to Export .

    3. Click on "X" Export to Excel Button

    4. It will open a window. Select "Static worksheet with  records from this page" option.

    5. Click on Export Button and Save the file.

    If you want to export the Security Roles from the current or and wanted to import to another org, then you can

    1. Go to CRM App -> Settings -> Customizations -> Export Customisation->

    2. Select "Security Roles" from the VIEW dropdown.

    2. Select the Roles which you want to Export .

    3. Click on "Export Selected Customisations" Button.

    4. It will open a window. Save the file.

    5. Go to other organisaion and import it.

    Hope this helps.


    Thanks, Ranjitsingh R | http://mscrm-developer.blogspot.com/ | MS CRM Consultant
    • Proposed as answer by Ranjitsingh R Tuesday, August 10, 2010 4:51 PM
    Tuesday, August 10, 2010 4:51 PM
  • Hi,

    Faisal means the 'Excel' icon within the view which lists the security roles (settings > administration > security roles). It shows you the names of all the security roles but not much else

    Take a look at this utility http://crm40admin.codeplex.com/ it allows you to export the security role priveliges to a csv file. It isn't pretty but may save you manually creating an Excel sheet from scratch!

    Hope that saves you some time!

    Rob


    CRM4 MBSS
    Tuesday, August 10, 2010 4:51 PM
  • Hi

    Here is a Select statement that you can run on your CRM DB to get roles and access levels. I've built this on my own .. Do you want to give it a try and let me know if it works for you?

    PS: this only works for custom roles, if you want it to retrieve a full set please remove the where clause.....

    SELECT 
    FilteredRole.name, 
    EntityView.PhysicalName,
    Privilege.Name,
    AccessLevel = 
    	CASE Privilege.AccessRight 
    		WHEN 1 THEN 'READ'
    		WHEN 2 THEN 'WRITE'
    		WHEN 4 THEN 'APPEND'
    		WHEN 16 THEN 'APPENDTO'
    		WHEN 32 THEN 'CREATE'
    		WHEN 65536 THEN 'DELETE'
    		WHEN 262144 THEN 'SHARE'
    		WHEN 524288 THEN 'ASSIGN'
    	END,
    SecurityLevel = 
    CASE PrivilegeDepthMask
    WHEN 1 THEN 'User'
    WHEN 2 THEN 'Business Unit'
    WHEN 4 THEN 'Parent: Child Business Unit'
    WHEN 8 THEN 'Organisation'
    END FROM RolePrivileges inner join FilteredRole on RolePrivileges.RoleId = FilteredRole.roleid Inner Join PrivilegeObjectTypeCodes on RolePrivileges.PrivilegeId = PrivilegeObjectTypeCodes.PrivilegeId Inner Join Privilege on RolePrivileges.PrivilegeId = Privilege.PrivilegeId Inner Join EntityView on EntityView.ObjectTypeCode = PrivilegeObjectTypeCodes.ObjectTypeCode WHERE FilteredRole.roletemplateid is null ORDER BY FilteredRole.name, EntityView.PhysicalName, Privilege.AccessRight

    Hope this is useful because it uses SQL it is not supported but again I guess there is no harm in reading from tables and views.

    Thanks

    Amar

    • Edited by Amarsen Vangoor Wednesday, August 18, 2010 10:21 AM Resolved privilege depth mask
    • Proposed as answer by Faisal Fiaz Thursday, September 16, 2010 3:50 PM
    Wednesday, August 11, 2010 2:20 PM
  • Hi Amar

    This query is almost exactly what I'm looking for, for my own extract. I just also need to group the privileges by UI page (Core Records, Sales, Business Management, etc.). Do you know whether these names are stored in a table somewhere, and whether I can just do an extra join to include them?

    Best regards,

    James

    Thursday, May 22, 2014 8:48 AM