Defender for Office 365 - Teams Messages
Teams Messages
Query
MessageEvents
| join kind=leftouter MessageUrlInfo
on $left. TeamsMessageId == $right. TeamsMessageIdAbout this query
Explanation
This query is designed to gather information about Microsoft Teams messages within an organization using Microsoft Defender for Office 365. Here's a simple breakdown of what the query does:
-
Data Sources:
- The query uses two tables:
MessageEventsandMessageUrlInfo. MessageEventscontains details about messages sent and received at the time of delivery.MessageUrlInfocontains information about URLs included in Microsoft Teams messages.
- The query uses two tables:
-
Purpose:
- The goal is to retrieve information about Teams messages and any URLs that were included in those messages.
-
How It Works:
- The query performs a "left outer join" operation between the
MessageEventstable and theMessageUrlInfotable. - It matches records from both tables based on a common field called
TeamsMessageId. - This means it will take all records from
MessageEventsand add any matching URL information fromMessageUrlInfobased on theTeamsMessageId.
- The query performs a "left outer join" operation between the
-
Outcome:
- The result will be a combined dataset that includes details of Teams messages along with any URLs that were part of those messages, even if some messages don't have associated URLs.
In summary, this query is used to analyze Microsoft Teams messages and any URLs they contain, helping to monitor and investigate communication within an organization.
Details

Alex Verboon
Released: May 6, 2025
Tables
MessageEventsMessageUrlInfo
Keywords
TeamsMessagesURLsSecurityEvents
Operators
joinkind=leftouteron