If you want to generate a report automatically, you will need to use a script to do it. For Message Trace, it could only be used to check logs within 10 days (About Historical Search, it isn't suitable used in a script):
So, you could use the script below to check logs every 10 days.
$User = "******@domain.onmicrosoft.com"
$PassWord = ConvertTo-SecureString -String "Password" -AsPlainText -Force
$UserCredential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PassWord
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
$Start = (Get-Date).AddDays(-10).ToString('MM/d/yyyy')
$End = (Get-Date).AddDays(+1).ToString('MM/d/yyyy')
$filename = (Get-Date).ToString('MM-d-yyyy')
$Receive = (Get-MessageTrace -RecipientAddress ******@domain.onmicrosoft.com -EndDate $End -StartDate $Start).count
$Send = (Get-MessageTrace -SenderAddress ******@domain.onmicrosoft.com -EndDate $End -StartDate $Start).count
$data = "From "+$Start+" to "+$End+" Receive "+$Receive+" Send "+ $Send >> c:\temp\$filename.txt
Remove-PSSession $Session
- Make sure you could connect to Exchange online with basic auth.
- Modify those parameters before running: $User, $PassWord, -RecipientAddress, -SenderAddress, c:\temp
You could use Windows Task Scheduler to run this script every 10 days.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.