Query Details
# Microsoft Teams Emoji Reactions for each Department
## Query Information
#### Description
This query lists the statistics of the Emoji reactions that have been send via Microsoft Teams for each Department.
## Defender For Endpoint
```KQL
CloudAppEvents
| where Application == "Microsoft Teams"
| where ActionType == "ReactedToMessage"
| extend Emoji = tostring(RawEventData.MessageReactionType)
| where isnotempty(Emoji)
| project Emoji, AccountObjectId
| join kind=inner (IdentityInfo
| where Timestamp > ago(30d)
| summarize arg_max(Timestamp, *) by AccountObjectId
| project AccountObjectId, Department)
on $left.AccountObjectId == $right.AccountObjectId
| project Department, Emoji
| evaluate pivot(Department) // If you want to have the Departments on the y axis use | evaluate pivot(Emoji)
```
## Sentinel
```KQL
CloudAppEvents
| where Application == "Microsoft Teams"
| where ActionType == "ReactedToMessage"
| extend Emoji = tostring(RawEventData.MessageReactionType)
| where isnotempty(Emoji)
| project Emoji, AccountObjectId
| join kind=inner (IdentityInfo
| where TimeGenerated > ago(30d)
| summarize arg_max(TimeGenerated, *) by AccountObjectId
| project AccountObjectId, Department)
on $left.AccountObjectId == $right.AccountObjectId
| project Department, Emoji
| evaluate pivot(Department) // If you want to have the Departments on the y axis use | evaluate pivot(Emoji)
```This query retrieves statistics on Emoji reactions sent via Microsoft Teams for each department. It filters the CloudAppEvents data for reactions to messages in Microsoft Teams, extracts the Emoji type, and joins it with the IdentityInfo data to get the department information for each user. The final result is a pivot table showing the count of Emoji reactions for each department.

Bert-Jan Pals
Released: December 28, 2023
Tables
Keywords
Operators