OneDrive Compliance Export Has Missing File Names
🔍 WiseChecker

OneDrive Compliance Export Has Missing File Names

When you export content from OneDrive using Microsoft Purview compliance tools, you expect every exported file to have a clear, recognizable file name. Instead, you may see blank entries, generic placeholders like “Document.docx,” or file names that do not match the original files. This problem typically occurs because the compliance export process strips or anonymizes metadata to meet privacy and security requirements. This article explains why file names go missing, how to retrieve the correct names, and what to do if the export still does not meet your needs.

Key Takeaways: Restoring Missing File Names in OneDrive Compliance Exports

  • Microsoft Purview compliance portal > Content search > Export results: The default export method anonymizes file names to protect privacy; check the “Enable de-duplication” setting before exporting.
  • Export results as CSV or PST: Choosing CSV exports preserves original file names in the metadata; PST exports may show generic names but retain original file paths in the message headers.
  • Report.csv file inside the export ZIP: This report contains the original file name, location, and size for every exported item; use it to map generic names back to real file names.

ADVERTISEMENT

Why OneDrive Compliance Export Removes or Anonymizes File Names

Microsoft Purview compliance exports are designed primarily for eDiscovery and legal review, not for direct file restoration. When you run a content search in the Microsoft Purview compliance portal and export the results, the system generates a ZIP file containing the exported items. By default, the export process renames files to prevent reviewers from seeing potentially sensitive file names. This anonymization is intentional: it reduces the risk of exposing confidential information during the review phase.

The renaming follows a pattern. Each file receives a generic name such as “Document1.docx” or “Email1.msg.” The original file name is stored only in the metadata, which is included in a separate report file inside the export ZIP. If you do not check this report, you will see only the anonymized names.

How the Export Process Handles OneDrive Files

When you export OneDrive files through a compliance content search, the system treats each file as an individual item. The original file name is recorded in the “OriginalPath” column of the export report. The actual file in the export folder is renamed to a numeric or hash-based identifier. This behavior is the same for SharePoint Online document libraries, team site files, and OneDrive personal folders.

The Role of De-Duplication

The export settings include an option called “Enable de-duplication.” When this option is turned on, the system removes duplicate copies of the same file across different mailboxes or sites. De-duplication can also cause file name changes because the system keeps only one instance of the file and renames it to a generic identifier. If you need every version or copy to retain its original name, you must disable de-duplication before exporting.

Steps to Export OneDrive Files With Correct File Names

Follow these steps to export OneDrive content from the compliance portal while preserving original file names. These instructions assume you have the necessary permissions in Microsoft Purview, such as the eDiscovery Manager role.

  1. Open the Microsoft Purview compliance portal
    Go to https://compliance.microsoft.com and sign in with your work or school account. Navigate to Content search under the Solutions section.
  2. Create or open a content search
    Select an existing search that targets OneDrive locations, or create a new search. In the search query, specify the OneDrive site URLs or use the location picker to select specific user OneDrive accounts.
  3. Run the search and review results
    Click Search and wait for the search to complete. Review the results to confirm the correct files are included. If the file count is zero, check your location selection and query syntax.
  4. Start the export
    Click Actions and select Export results. The export settings pane opens.
  5. Configure export options
    In the export settings, set the following:
    Output format: Choose One or more CSV files (not PST). CSV files preserve original file names in the metadata.
    Enable de-duplication: Uncheck this box if you want every copy of a file to appear with its original name. Leave it checked only if you need a single instance of each unique file.
    Export options: Leave Export files in a compressed folder selected.
  6. Export the results
    Click Export. The system prepares a ZIP file containing the exported items and a report. Download the ZIP file when ready.
  7. Open the export report to find original file names
    Extract the ZIP file. Inside, locate the file named Results.csv or Report.csv. Open it in Excel or a text editor. The OriginalPath column contains the full path and original file name of each exported item. Use this column to map generic file names back to their real names.
  8. Rename exported files using the report (optional)
    If you need the actual files to have their original names, write a script or use a bulk rename tool. For example, in PowerShell, you can loop through the CSV and rename each file based on the OriginalPath value. This step is manual and not provided by the export tool itself.

ADVERTISEMENT

If the Export Still Has Missing File Names

“Export results as PST” shows generic file names

When you export as PST, the system converts OneDrive files into email message items within the PST file. The original file name is stored in the message body or as an attachment name, but the PST folder structure uses generic names. To find the original name, open each PST item and check the attachment details or the message metadata. Alternatively, re-run the export as CSV to get the report with original names.

“Report.csv” is missing or empty

If the report file is missing, the export may have failed or been interrupted. Re-run the export and ensure the download completes fully. Large exports may take hours. If the report is empty, the search results did not include any OneDrive items. Verify that your content search includes the correct OneDrive locations and that the files exist in those locations.

“OriginalPath” column shows a URL instead of a file name

The OriginalPath column may display the full OneDrive URL rather than just the file name. This is normal. The URL includes the site collection, folder, and file name. Extract the file name from the end of the URL. For example, from https://contoso-my.sharepoint.com/personal/user_contoso_com/Documents/Report.xlsx, the file name is Report.xlsx.

OneDrive files appear as “Document.docx” with no original name in the report

This can happen if the file was stored in a SharePoint document library that uses versioning, and the compliance search indexed only the current version. The report may show the generic name for older versions. To include all versions, configure the content search to include version history. In the search query, add IncludeVersions:true in the KQL syntax.

CSV Export vs PST Export: Key Differences for File Names

Item CSV Export PST Export
File name preservation Original names stored in CSV metadata Generic names in PST folder structure
Ease of mapping Direct mapping via OriginalPath column Requires opening each PST item
De-duplication effect Can be disabled to keep all copies Always merges duplicates
Best use case Audit, forensic review, data recovery Legal review in Microsoft 365 eDiscovery
Export report included Yes (Results.csv) No separate report

Choose CSV export when you need to trace each file back to its original name. Use PST export only when your review tool requires PST format and you can accept the extra step of extracting names from the email items.

You now know how to retrieve missing file names from a OneDrive compliance export by using the CSV report and disabling de-duplication. Next, try exporting a small test search to verify the file names appear correctly. For large exports, consider writing a PowerShell script that reads the Results.csv file and renames the exported items automatically to save time.

ADVERTISEMENT