Forum Discussion

gukang83035207's avatar
gukang83035207
Copper Contributor
Jul 30, 2024

How to use PowerShell cmdlet to export content search results and download locally on Linux Server?

I need to do a compliance project. I want to export the content search results to a specific location, and then download them locally. How do I use the PowerShell cmdlet such as New-ComplianceSearchAction -Export to reach the goal, please?

 

I saw one solution like this :

1.Export the data via New-ComplianceSearchAction -Export cmdlet;

2. Use eDiscovery Export Tool to download locally.

The link is : https://techcommunity.microsoft.com/t5/microsoft-365/export-to-pst-via-powershell/m-p/95007. But I have a question: The eDiscovery tool is just available in Windows system, right? I need to release the system on Linux Server. 

 

Any help or guidance would be greatly appreciated!

    • gukang83035207's avatar
      gukang83035207
      Copper Contributor

      Hi Kidd_Ip Thank you very much for your reply. I saw one possible solution like this:
      1. Create one new content search:
      New-ComplianceSearch "your_descriptive_name" -ExchangeLocation all | Start-ComplianceSearch


      2. Execute the search:
      New-ComplianceSearchAction "your_descriptive_name" -Export -Format Fxstream


      3.Once the tool finishes exporting the results, you can run the Get-ComplianceSearchAction cmdlet to find out the url required to download the exported data:


      Get-ComplianceSearchAction "your_descriptive_name_export" -IncludeCredential | FL


      The Results include two pieces of information you need to download the PSTs: the Container url and the SAS token. Together, they form a full URL.


      4. Use Azcopy to download the result from the URL(use SAS token) which could be got by step3.

      Confirm serveral questions, pls:
      1.Is this solution available on Linux Server?
      2.If this solution available, could you help to share one sample data about step3? I don't know the exact structure of the data.
      3. Is there a better solution, pls?

      Thank you very much!

Resources