How to use PowerShell to track office365 messages
1. First link to Exchange Online management above
$UserCredential = get-= new-pssession-configurationname Microsoft.exchange-connectionuri https:// partner.outlook.cn/powershell-credential $UserCredential-authentication basic-allowredirection Import-pssession $Session
2. Query message tracking, export UTF-8 to CSV file
get-= $dateEnd. AddHours (-8) #目前时间之前的8个小时之内 $recipient="[email Protected]" #导出收件人是 [email protected] User #自定义时间, convert time zone Get-messagetrace-startdate $ Datestart-enddate $dateEnd-recipientaddress $recipient | Select-object @{name='time'; E={[system.timezone]::currenttimezone.tolocaltime ($_ . Received)}}, Senderaddress, RecipientAddress, Subject, Status, Toip, FROMIP, Size, MessageID, Messagetraceid | Export-csv-encoding UTF8 D:\Only.csv
How Office 365 uses PowerShell to query for message tracking