Query Details
//Email forwarding OfficeActivity | where OfficeWorkload == "Exchange" | where Operation == "Set-Mailbox" | extend Name_ = tostring(parse_json(Parameters)[2].Name) | where Name_ == "DeliverToMailboxAndForward" | extend ForwardingSMTP_Value_ = tostring(parse_json(Parameters)[1].Value) | where ForwardingSMTP_Value_ != "" | project TimeGenerated, ForwardingSMTP_Value_, Name_, UserId
This query is looking for instances of email forwarding in the OfficeActivity logs. It filters for Exchange workload and the "Set-Mailbox" operation. It then extracts the name of the mailbox and checks if it has the "DeliverToMailboxAndForward" setting enabled. If it is enabled, it extracts the email address it is forwarding to. Finally, it projects the time, forwarding email address, mailbox name, and user ID.

Rod Trent
Released: July 13, 2021
Tables
Keywords
Operators