web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Auditing the data exports in Dynamics CRM

(3) ShareShare
ReportReport
Posted on by 1,023
Hello, 
 
Is there any way that we can audit the data exports in Dynamics crm.
 
Thanks.
I have the same question (0)
  • Suggested answer
    PerezAguiar Profile Picture
    Microsoft Employee on at
    Hey!
     
    Could you provide more details? Do you want to audit WHO clicks on the "export data"? or if the data exported matches the source information?

    From documentation on https://learn.microsoft.com/en-us/power-platform/admin/manage-dataverse-auditing, auditing does not support export operation, so I'm afraid auditing "who clicks on the export button" is not supported.
     
    Regards,
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,835 Super User 2025 Season 2 on at
    Hello yify,
     

    Yes, there are ways to audit data exports in Dynamics 365 CRM (Power Apps), although it's not always a straightforward, out-of-the-box feature that captures every single export scenario. The level of auditing depends on the method used for export and the configurations you have in place.

    Here's a breakdown of the different export methods and how you can potentially audit them:

    1. Export to Excel (from Views):

    • Auditing Capability: Standard auditing in Dynamics 365 does not directly track when a user clicks the "Export to Excel" button from a view. This action is primarily client-side.
    • Potential Indirect Auditing: You might be able to infer some exports based on other audited activities. For example, if a user frequently accesses a specific view and then shortly after performs other actions, you might suspect an export. However, this is not a reliable method.
    • Workaround (Less Ideal): You could potentially develop a custom ribbon button to replace the OOB "Export to Excel" button. This custom button could trigger an audit log entry before initiating the actual export. However, this requires development effort and might not cover all export paths.

    •  

    2. Export to CSV (from Views):

    • Auditing Capability: Similar to "Export to Excel," standard auditing does not directly track "Export to CSV" actions.

    •  

    3. Data Export Service (to Azure Blob Storage):

    • Auditing Capability: The Data Export Service itself does not have built-in auditing of when it runs or what data is exported in the traditional Dynamics 365 audit logs.
    • Azure Blob Storage Logs: You can enable Azure Blob Storage logging to track access and operations on the storage account where the data is being exported. This will show when files were created or accessed, which can indirectly indicate export activity. However, it won't directly link it back to a specific user action within Dynamics 365.

    •  

    4. Power Automate Flows for Export:

    • Auditing Capability: Actions within a Power Automate flow are generally audited within the Power Platform audit logs. If users are manually triggering a flow to export data, or if a scheduled flow runs, you can see the flow runs in the audit logs.
    • Content of Export: The audit logs will show that the flow ran, but they typically won't contain details of the data that was exported. You would need to examine the flow's actions to understand what data was being retrieved and sent.

    •  

    5. Custom Code (Plugins, Web Resources) for Export:

    • Auditing Capability: If you have custom code that exports data (e.g., a plugin triggered by a user action or a Web Resource initiated export), you have the most control over auditing.

    • Best Practice: Within your custom code, you should explicitly create audit log entries using the IOrganizationService.Create method on the audit entity. You can include details like:

      • The user who initiated the export (callerid).
      • The type of data exported.
      • The method of export.
      • Timestamps. 

    • Example Audit Log Creation in Plugin (Conceptual):
    using Microsoft.Xrm.Sdk;
    using System;
    public class AuditDataExportPlugin : IPlugin
    {
        public void Execute(IServiceProvider serviceProvider)
        {
            IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
            IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
            IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
            if (context.MessageName.ToLower() == "yourcustomexportaction") // Example trigger
            {
                Entity audit = new Entity("audit");
                audit["operation"] = new OptionSetValue(100); // Custom Operation Code
                audit["objecttypecode"] = "your_exported_entity"; // Name of the exported entity
                audit["objectid"] = null; // Optionally link to a specific record
                audit["changedata"] = $"Data exported by user {context.InitiatingUserId}";
                audit["createdby"] = new EntityReference("systemuser", context.InitiatingUserId);
                audit["createdon"] = DateTime.UtcNow;
                service.Create(audit);
            }
        }
    }

    6. Accessing Data Through APIs (Web API, SDK):

    • Auditing Capability: Accessing data through the Dynamics 365 Web API or SDK is generally not directly audited in the standard audit logs for data retrieval.
    • Potential Indirect Auditing: You might see audit logs for actions performed on the data after retrieval (e.g., updates, deletions), but the act of querying and retrieving data for external use isn't typically logged.
    • Security Considerations: This highlights the importance of proper security roles and access controls to limit who can access data through APIs.


    •  

    Best Approach and Recommendations:

    • For Out-of-the-Box Exports (Excel, CSV): There isn't a direct auditing mechanism. If this is a critical requirement, consider:

      • Custom Ribbon Buttons with Auditing: Develop custom buttons to log the export action.
      • Educate Users: Implement clear policies and guidelines regarding data export and emphasize accountability. 

    • For Automated Exports (Data Export Service, Power Automate):

      • Monitor Azure Blob Storage Logs: Enable logging on your Azure storage.
      • Review Power Automate Run History: Check the run history of your flows.
      • Include Audit Logging in Flows (Custom): If sensitive data is being exported via Power Automate, consider adding steps within the flow to write to a custom log entity or an external logging service. 

    • For Programmatic Exports (Custom Code): Explicitly implement audit logging within your code to track these activities.

    • Focus on Prevention and Access Control: The most effective way to manage data security is to implement strong security roles, limit user access to sensitive data, and educate users on data handling policies.

    •  

    In summary, while Dynamics 365's standard auditing doesn't comprehensively track all data export methods out of the box, you can achieve auditing for custom export solutions and gain some indirect visibility for automated exports. For standard "Export to Excel/CSV," custom development might be necessary if detailed auditing is a strict requirement.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans