Exchange Online: การติดตามข้อความด้วย PowerShell
การติดตามข้อความใน Exchange Online สามารถทำได้ทั้งแบบกราฟิกและใน PowerShell ในโพสต์นี้ ฉันจะแสดงวิธีการติดตามข้อความด้วย PowerShell และคุณจะได้รับสคริปต์ที่คุณสามารถใช้ในสภาพแวดล้อมของคุณได้ กระโดดเข้าไปเลย
ข้อกำหนดเบื้องต้น
หากยังไม่ได้ดำเนินการ เราจำเป็นต้องติดตั้ง Exchange Online Management Module และเชื่อมต่อกับ Exchange Online
Install-Module ExchangeOnlineManagement -Force -AllowClobber
Connect-ExchangeOnline
การติดตามข้อความใน PowerShell
ต่อไป ฉันจะแสดง 4 ตัวอย่างวิธีที่คุณสามารถติดตามข้อความสำหรับกล่องจดหมายเพื่อแสดงผลลัพธ์ทั้งในคอนโซล ในไฟล์ หรือในหน้าต่างแยกต่างหาก
Get-MessageTrace -SenderAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 # Max. 10 Tage
Get-MessageTrace -SenderAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 | Out-GridView
Get-MessageTrace -SenderAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 | Out-File $home\trace.txt
Get-MessageTrace -SenderAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 | Export-Csv $home\trace.csv
หากต้องการแสดงอีเมลทั้งหมดที่ส่งถึงผู้รับเฉพาะ คุณสามารถใช้คำสั่งนี้ได้
Get-MessageTrace -RecipientAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022
คุณไม่ทราบที่อยู่ผู้ส่งหรือผู้รับอย่างชัดเจน? ไม่มีปัญหา เราสามารถใช้งานไวด์การ์ดได้
Get-MessageTrace -RecipientAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 |
Where-Object SenderAddress -like "*.*udemy*"
Get-MessageTrace -SenderAddress user@domain.com -StartDate 08/10/2022 -EndDate 08/20/2022 |
Where-Object RecipientAddress -like "*win*"
โปรดทราบว่าการค้นหาอีเมลนั้นจำกัดไว้ที่ 10 วันที่ผ่านมา อย่างไรก็ตาม มีวิธีแก้ไขชั่วคราวซึ่งเรียกว่าการค้นหาในอดีต
Start-HistoricalSearch -ReportTitle "TestSearch" -StartDate 6/1/2022 -EndDate 8/1/2022 -ReportType MessageTrace `
-SenderAddress user@domain.com -NotifyAddress user@domain.com
Get-HistoricalSearch
ฉันหวังว่าภาพรวมนี้จะเป็นประโยชน์สำหรับคุณ