Hi,@
For the second question you can refer to the following script:
# 1. Deadline for calculationv
$cutoffDate = (Get-Date).AddYears(-1).ToString("yyyy-MM-dd")
$searchQuery = "received<='$cutoffDate'"
$mailbox = "user@example.com"
# 2. Create a new compliance search task
New-ComplianceSearch -Name "OldEmailsSearch" -ExchangeLocation $mailbox -ContentMatchQuery $searchQuery
# 3. Start the search task
Start-ComplianceSearch -Identity “OldEmailsSearch”
# 4. Export results
New-ComplianceSearchAction -SearchName "OldEmailsSearch" -Export -Format FxStream