Query Details

Teams Emoji Reactions By Department

Query

# 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)
```

Explanation

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.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: December 28, 2023

Tables

CloudAppEventsIdentityInfo

Keywords

MicrosoftTeams,CloudAppEvents,Application,ActionType,ReactedToMessage,Emoji,RawEventData,MessageReactionType,isnotempty,AccountObjectId,IdentityInfo,Timestamp,Department,evaluate,pivot,TimeGenerated

Operators

whereextendisnotemptyprojectjoinonsummarizearg_maxbyevaluatepivot

Actions