Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Office 365/officeactivity-purviewsendasaudit.kql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//Find messages where the SendAs or SendOnBehalfOf right was used
OfficeActivity 
| where Operation in ("SendAs", "SendOnBehalfOf")
//Extract the Item table to find the MessageId
| mv-expand todynamic(Item)
| extend InternetMessageId = tostring(Item.InternetMessageId)
//Trim extra rows created by mv-expand
| where isnotnull(InternetMessageId )
| project TimeGenerated, Operation, SendAsUserSmtp, UserId, Client_IPAddress, OfficeWorkload, RecordType, InternetMessageId,MailboxOwnerUPN
//inner join will filter EmailEvents to just those with the InternetMessageId
|join kind=inner (
EmailEvents
| extend tostring(InternetMessageId)
//Exposing the RecipientEmailAddress
| project EmailAction, RecipientEmailAddress, SenderMailFromAddress, Subject, InternetMessageId
) on InternetMessageId
|project TimeGenerated, Operation, EmailAction, SendAsUserSmtp, UserId, RecipientEmailAddress, Subject, MailboxOwnerUPN, SenderMailFromAddress