How to Export the Audit History Values from Dynamics 365

Microsoft Dynamics 365 supports Audit Logging of various events. Authorized users can view the Audit History on any Dynamics 365 tables enabled for Auditing.

However, there is NO Export audit data function available from the Dynamics 365 Audit History or Audit Summary View.

The good news is that there is an out of the box option via Microsoft 365 Compliance’s Audit to Export the Dynamics 365 audit data including the Changed Values.

Here is an example from the Microsoft Dynamics 365 Audit History showing a Create and two Updates for “Test Contact 210409” record: Notice that there is NO option to export this data from the Dynamics 365 Contact’s Audit History view.

Now let’s look at this result from the Microsoft 365 compliance Audit Search on Dynamics 365 activities. Notice that there is the option to Download all results!

The Download is a CSV file. Notice that column D “AuditData” is in JSON format.

Excel has the option to transform/format the column JSON to regular Excel columns using Power Query Editor. Here is a link to the steps to format the exported audit log

After the transform and expansion of the AuditData columns. Then another level expansion of the AuditData.Fields column yielded the Audit History Field values in a pretty standard and easy to analyze Excel format:

Note: Dynamics 365 Audit Log data IS NOT immediately available in Microsoft 365 Compliance – takes up to 24 hours AFTER the event occurs for the corresponding audit log record to be returned

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

About Frank Lee

Microsoft Dynamics 365 CRM/PowerApps consultant in San Francisco, USA.  Awarded the Microsoft MVP (Dynamics 365/CRM) 12 consecutive years from 2006 to 2018. Actively involved with Microsoft Dynamics CRM implementations since Microsoft CRM v1.0 beta (2002). Super passionate about everything CRM/PowerApps, especially in the areas of Cloud Computing, A.I., Digital Transformation and Automation.
This entry was posted in Dynamics 365 and tagged , , . Bookmark the permalink.

5 Responses to How to Export the Audit History Values from Dynamics 365

  1. Pingback: How to Export the Audit History Values from Dynamics 365 - 365 Community

  2. Frank Lee says:

    A question came up regarding how to automate the this Audit History export from Microsoft 365 Compliance – one option would be to try using Windows built-in scheduling tool, Task Scheduler and the PowerShell cmdlet: Search-UnifiedAuditLog.

    Here is the link to more info on Search-UnifiedAuditLog:
    https://docs.microsoft.com/en-us/powershell/module/exchange/search-unifiedauditlog

  3. Frank Lee says:

    A question came up regarding if able to download the audit log from 3 years ago or only applicable for the same year logs. I would check the audit audit log retention policy setup – here is the link:
    https://docs.microsoft.com/en-us/microsoft-365/compliance/audit-log-retention-policies

    Or check out XrmToolBox Audit History Extractor
    https://www.xrmtoolbox.com/plugins/AuditHistoryExtractor/

  4. Nairel says:

    Would you be able to see the changes regarding Associate Entities/Disassociate entities through the Office 365 Compliance Center? In CRM you can see in the audit if there were any changes to a users security profile roles (which is know as Associate Entities/Disassociate Entities). Would you be able to see that in the Microsoft 365 Compliance Audit?

Leave a comment