Forum Discussion

gukang83035207's avatar
gukang83035207
Copper Contributor
Jul 29, 2024

How to use New-ComplianceSearchAction -Export to export content search results and download locally?

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

 

I saw one solution like this:

1. Use New-ComplianceSearchAction -Export to export content search results to temporary storage address.

2. Use Get-ComplianceSearchAction to find the address.

3. Use Azcopy command to copy or download from the address.

 

But I don't find out how to do this with PowerShell commands. Any one could help to give one sample, please? Any help or guidance would be greatly appreciated!

 

Below link is also my related question:

https://techcommunity.microsoft.com/t5/windows-powershell/how-to-use-new-compliancesearchaction-export-to-export-results/m-p/4203207

    • When you export search results, the data is temporarily stored in a Microsoft-provided Azure Storage location in the Microsoft cloud before it's downloaded to your local computer. Be sure that your organization can connect to the endpoint in Azure, which is *.blob.core.windows.net (the wildcard represents a unique identifier for your export). The search results data is deleted from the Azure Storage location two weeks after it's created.
    • If your organization uses a proxy server to communicate with the Internet, you need to define the proxy server settings on the computer that you use to export the search results (so the export tool can be authenticated by your proxy server). To do this, open the machine.config file in the location that matches your version of Windows.
      • 32-bit: %windir%\Microsoft.NET\Framework\[version]\Config\machine.config
      • 64-bit: %windir%\Microsoft.NET\Framework64\[version]\Config\machine.config
        <system.net>
           <defaultProxy enabled="true" useDefaultCredentials="true">
             <proxy proxyaddress="https://ProxyServer :Port " 
                    usesystemdefault="False" 
                    bypassonlocal="True" 
                    autoDetect="False" />
           </defaultProxy>
        </system.net>
      • Add the following lines to the machine.config file somewhere between the <configuration> and </configuration> tags. Be sure to replace ProxyServer and Port with the correct values for your organization; for example, proxy01.contoso.com:80.

    For more information, please visit: Export Content search results | Microsoft Learn

    • When you export search results, the data is temporarily stored in a Microsoft-provided Azure Storage location in the Microsoft cloud before it's downloaded to your local computer. Be sure that your organization can connect to the endpoint in Azure, which is *.blob.core.windows.net (the wildcard represents a unique identifier for your export). The search results data is deleted from the Azure Storage location two weeks after it's created.
    • If your organization uses a proxy server to communicate with the Internet, you need to define the proxy server settings on the computer that you use to export the search results (so the export tool can be authenticated by your proxy server). To do this, open the machine.config file in the location that matches your version of Windows.
      • 32-bit: %windir%\Microsoft.NET\Framework\[version]\Config\machine.config
      • 64-bit: %windir%\Microsoft.NET\Framework64\[version]\Config\machine.config
        <system.net>
           <defaultProxy enabled="true" useDefaultCredentials="true">
             <proxy proxyaddress="https://ProxyServer :Port " 
                    usesystemdefault="False" 
                    bypassonlocal="True" 
                    autoDetect="False" />
           </defaultProxy>
        </system.net>
      • Add the following lines to the machine.config file somewhere between the <configuration> and </configuration> tags. Be sure to replace ProxyServer and Port with the correct values for your organization; for example, proxy01.contoso.com:80.

    For more information, please visit: Export Content search results | Microsoft Learn

  • Cullen2135's avatar
    Cullen2135
    Copper Contributor

    I've solved this problem.  Originally my script would export the results and then I had to manually open the export from the O365 Compliance - ediscovery.  After I found a module work on my Andyroutt, I took some of the script and combined it with mine.  This is the script by Andy - https://github.com/andyroutt/eDiscovery-Export-Tool

Resources