Commands › Exchange Online

Export-ActivityExplorerData

Exchange Online ExchangeOnlineManagement Export-*

For more information, see Security & Compliance PowerShell. Use the Export-ActivityExplorerData cmdlet to export activities from Data classification \> Activity Explorer in the Microsoft 365 Purview compliance portal. Activity explorer reports on up to 30 days worth of data.

Quick start script

# Export-ActivityExplorerData — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Export-ActivityExplorerData -EndTime <DateTime> -OutputFormat <String> -StartTime <DateTime> | Format-List

# 3. Export for evidence / drift tracking
Export-ActivityExplorerData | Export-Clixml .\ActivityExplorerData-$(Get-Date -Format yyyyMMdd).xml

Syntax

Export-ActivityExplorerData -EndTime <DateTime> -OutputFormat <String> -StartTime <DateTime>
 [-Filter1 <String[]>]
 [-Filter2 <String[]>]
 [-Filter3 <String[]>]
 [-Filter4 <String[]>]
 [-Filter5 <String[]>]
 [-PageCookie <String>]
 [-PageSize <Int32>]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-EndTime DateTime yes The EndTime parameter specifies the end date of the date range.
-OutputFormat String yes The OutputFormat parameter specifies the output format. Valid values are:
-StartTime DateTime yes The StartTime parameter specifies the start date of the date range.
-Filter1 String[] The Filter1 parameter filters the data to export. This parameter takes a minimum of two values as input: a filter name and at least one filter value. For example, `@("Activity", "LabelApplied")` returns records with...
-Filter2 String[] The Filter2 parameter filters the data to export. This parameter has the same syntax requirements as the Filter1 parameter, the same OR behavior for multiple values in the same parameter, and the same AND behavior...
-Filter3 String[] The Filter3 parameter filters the data to export. This parameter has the same syntax requirements as the Filter1 parameter, the same OR behavior for multiple values in the same parameter, and the same AND behavior...
-Filter4 String[] The Filter4 parameter filters the data to export. This parameter has the same syntax requirements as the Filter1 parameter, the same OR behavior for multiple values in the same parameter, and the same AND behavior...
-Filter5 String[] The Filter5 parameter filters the data to export. This parameter has the same syntax requirements as the Filter1 parameter, the same OR behavior for multiple values in the same parameter, and the same AND behavior...
-PageCookie String The PageCookie parameter specifies whether to get more data when the value of the LastPage property in the command output is False. If you don't use the PageSize parameter, a maximum of 100 records are returned. If...
-PageSize Int32 The PageSize parameter specifies the maximum number of entries per page. Valid input for this parameter is an integer between 1 and 5000. The default value is 100. Consider using a smaller PageSize value to avoid...

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.