Tracciare invio e ricezione di email fallite su Office365


Connettersi tramite PowerShell a Office365:

  • $UserCredential = Get-Credential

  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

  • Import-PSSession $Session

Comando da eseguire per visualizzare le informazioni che cerchiamo:

  • Get-MessageTrace -SenderAddress stefano@marzorati.co -StartDate "10/17/2016 00:00:01" -EndDate "10/18/2016 23:59:59" | Select-Object Received, SenderAddress, RecipientAddress, Subject, Status, ToIP, FromIP, Size, MessageID, MessageTraceID | Where {$_.Status -eq "Failed"} | Out-GridView

Chudere la sessione:

  • Remove-PSSession $Session