1. Resources
  2. Detection sources
  3. New-InboxRule

New-InboxRule: An inbox rule was created in a mailbox from Outlook on the web or PowerShell

Recorded when an inbox rule is created in Outlook on the web or with New-InboxRule. A rule that forwards, redirects, deletes, or moves and marks as read mail matching keywords can hide or leak a user's mail.

Log source
Microsoft 365 unified audit log (Exchange)
Detection value
Supporting
Volume
Medium (estimate)
Last updated
Log
Microsoft 365 unified audit log (Exchange) (Microsoft 365 unified audit log (Exchange), on by default)
Service
Microsoft 365 unified audit log (Exchange)
Operation
New-InboxRule
Detects
1 attack (3 rules · 2 detection logic)
MITRE ATT&CK
2 techniques in 2 tactics
Threat groups
6 groups that MITRE ATT&CK records using these techniques
Fields the rules read
ParametersOperation

When it is written

Microsoft records New-InboxRule when a mailbox owner, or another user with access to the mailbox, creates an inbox rule in Outlook on the web, and when an admin or the user runs the cmdlet in Exchange Online PowerShell (Mailbox names another user's mailbox). Rules created in the Outlook desktop client are recorded differently, as the mailbox audit action UpdateInboxRules. Microsoft's sample record is an Exchange admin record (RecordType 1) that also carries the mailbox owner, the client and the session.

Parameters holds what the rule does. Conditions include From, SubjectContainsWords, BodyContainsWords, SubjectOrBodyContainsWords, FromAddressContainsWords and HeaderContainsWords; actions include ForwardTo, ForwardAsAttachmentTo and RedirectTo (send the message to other recipients), DeleteMessage (to Deleted Items), MoveToFolder, MarkAsRead and StopProcessingRules. Microsoft notes that creating or changing a rule from PowerShell removes client-side rules that Outlook had disabled.

Forwarding to external addresses is governed by the outbound spam policy: Microsoft disabled automatic external forwarding by default for new organizations in 2021, and then forwarding inbox rules to external recipients fail with a non-delivery report. Microsoft describes what happens to the messages, not to the rule: it does not say that creating the rule is refused or left unrecorded, so look for this record even where forwarding is blocked.

How to turn it on

Microsoft 365 unified audit log (Exchange) records New-InboxRule calls to Microsoft 365 unified audit log (Exchange) without any setup. Vendor documentation

Microsoft Purview Audit (Standard) is on by default for most Microsoft 365 organizations: every cmdlet run in the Exchange admin center or in Exchange Online PowerShell is recorded, except cmdlets whose verb is Get-, Search- or Test- and some service maintenance cmdlets that Microsoft does not log. Microsoft lists two exceptions where auditing is not on by default: tenants with Business Basic, Business Standard or Business Premium licences, and unmanaged tenants on enterprise trials. Check UnifiedAuditLogIngestionEnabled in Exchange Online PowerShell (in Security & Compliance PowerShell the property always reads False).

  • Mailbox actions (inbox rules created from Outlook, folder permission changes, mail access) also need mailbox auditing, which is on by default for user, shared and Microsoft 365 Group mailboxes (AuditDisabled is False). An account set to bypass mailbox auditing (Set-MailboxAuditBypassAssociation) leaves no mailbox audit records, and a mailbox whose audited actions were customised does not get new default actions. For users without an E5 licence, Microsoft notes that mailbox audit records are returned by the audit search, Search-UnifiedAuditLog and the Management Activity API only after mailbox auditing is enabled on the mailbox by hand (Set-Mailbox -AuditEnabled $true). Microsoft states this limit for mailbox audit events only, not for cmdlet records.
  • Retention follows the licence of the user who performed the activity: 180 days with Audit (Standard) (90 days for records created before 17 October 2023); with Audit (Premium) (E5 or an E5 Compliance or eDiscovery and Audit add-on) Exchange records are kept one year by default, and up to 10 years with a separate add-on licence and a retention policy.
  • Collection: the Office 365 Management Activity API publishes Exchange records in the Audit.Exchange content type. A subscription has to be started first (the first content can take up to 12 hours), each content blob can be downloaded for 7 days, and records do not arrive in order. Microsoft Sentinel's Microsoft 365 data connector with Exchange selected writes them to the OfficeActivity table, which is a free data source.
  • Delay: Microsoft guarantees no delivery time. Exchange records are typically available 60 to 90 minutes after the activity; Microsoft notes that an Exchange admin record can take up to 30 minutes to appear in an audit search.
  • Turning auditing off (Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $false) also stops the Management Activity API and Sentinel collection; the change itself is recorded as a Set-AdminAuditLogConfig record.
Check that the unified audit log is on (read only, Exchange Online PowerShell)
Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled
Based on vendor documentation.
Check that mailbox auditing is on for the organization (read only; False means on)
Get-OrganizationConfig | Format-List AuditDisabled
Based on vendor documentation.
See which default mailbox actions a mailbox audits (read only)
Get-Mailbox -Identity <MailboxIdentity> | Format-List AuditEnabled,DefaultAuditSet
Based on vendor documentation.
Check whether an account bypasses mailbox auditing (read only)
Get-MailboxAuditBypassAssociation -Identity <MailboxIdentity> | Format-List AuditByPassEnabled
Based on vendor documentation.
Find recent New-InboxRule records (read only)
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -Operations New-InboxRule -ResultSize 5 | Select-Object -ExpandProperty AuditData
Based on vendor documentation.

Fields

The operation’s own fields first, then the fields every Microsoft 365 unified audit log (Exchange) record has. Field names are the JSON paths of the record as the vendor documents it.

FieldWhat it holds
ParametersRead by 3 rulesThe parameters the cmdlet was run with, as Name and Value pairs: Name (the rule's name), the conditions (From, SubjectContainsWords, BodyContainsWords, SubjectOrBodyContainsWords, FromAddressContainsWords...) and the actions (ForwardTo, ForwardAsAttachmentTo, RedirectTo, DeleteMessage, MoveToFolder, MarkAsRead, StopProcessingRules), and Mailbox when the rule was created in another mailbox.
MailboxOwnerUPNThe owner of the mailbox the rule was created in.
MailboxGuidThe Exchange GUID of that mailbox.
ClientInfoStringThe client used, for example Client=OWA (Outlook on the web) or Client=WebServices (Exchange Web Services).
SessionIdIdentifier of the session the change was made in; links it to the other actions of the same session.
Fields every Microsoft 365 unified audit log (Exchange) record has (17)
FieldWhat it holds
CreationTimeWhen the record was generated, in UTC.
IdUnique identifier of the audit record.
OperationRead by 3 rulesThe activity. For Exchange admin records, the name of the cmdlet that was run; for mailbox audit records, the mailbox action. The operation this page is about.
RecordTypeThe kind of record (1 ExchangeAdmin for a cmdlet, 2 ExchangeItem and 3 ExchangeItemGroup for mailbox actions).
WorkloadThe Microsoft 365 service the activity happened in, Exchange for every record of this source.
OrganizationIdGUID of the Microsoft 365 tenant, the same in every service.
OrganizationNameThe name of the tenant.
UserIdUPN of the user who performed the activity. Activity of system accounts such as NT AUTHORITY\SYSTEM is recorded too.
UserKeyAn alternative ID for the user in UserId (the passport unique ID, PUID, for Exchange activity).
UserTypeWho performed the activity (0 Regular, 2 Admin, 3 DCAdmin, 4 System, 5 Application, 6 ServicePrincipal, 9 PartnerTechnician, 10 Guest...).
ClientIPAddress of the device used for the activity; for some services it can be the address of an application acting for the user.
ObjectIdFor Exchange admin records, the object the cmdlet changed (a mailbox, a rule, a policy, a role group); for mailbox audit records, what the action was done on.
ResultStatusWhether the activity succeeded. The schema gives True or False for Exchange admin records and Succeeded, PartiallySucceeded or Failed for others; Microsoft's own sample Exchange records also show Success, so match all of them.
ExternalAccessFor a cmdlet, true when it was run by Microsoft datacenter personnel, a datacenter service account or a delegated administrator, false when someone in your organization ran it. For a mailbox action, true when the user's domain differs from the mailbox owner's.
OriginatingServerThe Exchange server the cmdlet ran on, or the operation came from.
TokenObjectIdThe oid claim (object ID of the signed-in user or application) of the Microsoft Entra token behind the activity.
TokenTenantIdThe tid claim (tenant) of that token.

Values to know

Parameters

ValueMeaningSignal
ForwardTo, ForwardAsAttachmentTo or RedirectToThe rule sends matching messages to other recipientsWhat the forwarding rule reports. An external address is the case to confirm with the mailbox owner.Attack signal
DeleteMessage, MarkAsRead or MoveToFolder with a words conditionThe rule hides messages that match keywordsWhat the hiding rule reports; confirm with the mailbox owner that they set it up.Attack signal
MoveToFolder with From or a subject conditionOrdinary filing of mail into a folderMatched by the hiding rule only when a words condition is also present.Noise

ClientInfoString

ValueMeaningSignal
Client=OWACreated in Outlook on the webExpected
Client=WebServicesCreated through Exchange Web Services, by an application or a scriptCheck which application holds access to the mailbox.Worth knowing

Volume and noise

Users file mail with rules every day: MoveToFolder with From or a subject condition is the common, harmless shape. The detection rules look for shapes that hide or leak mail: forwarding or redirecting (ForwardTo, ForwardAsAttachmentTo, RedirectTo), deleting or moving and marking as read mail that matches keywords, which also matches newsletters routed to a folder. A rule created from an unusual ClientIP or client, or by someone other than the mailbox owner, is the record to read first.

Keeping it manageable

  • Read the actions in Parameters first. Forwarding to an external address, and moving or deleting mail that matches words in the subject or body, are the cases to raise.
  • Compare UserId with MailboxOwnerUPN; a rule created in someone else's mailbox needs an explanation.
  • Use SessionId and ClientIP to find the sign-in behind the change, and check it for a risky or unfamiliar sign-in (the rule's detection logic hypothesis).
  • Collect the forwarding addresses across all records; the same external address set on several mailboxes points to one actor.

Sample event

A Microsoft 365 unified audit log (Exchange) record in the vendor’s format, with made-up values.

{
  "CreationTime": "2026-11-18T09:30:12",
  "Id": "6f1c2d3e-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "Operation": "New-InboxRule",
  "OrganizationId": "00000000-0000-0000-0000-00000000c0de",
  "RecordType": 1,
  "ResultStatus": "True",
  "UserKey": "10032001A2B3C4D5",
  "UserType": 0,
  "Workload": "Exchange",
  "ClientIP": "203.0.113.24",
  "ObjectId": "InboxRule:00000000-0000-0000-0000-00000000e11e",
  "UserId": "j.doe@corp.example.com",
  "ExternalAccess": false,
  "OrganizationName": "corpexample.onmicrosoft.com",
  "OriginatingServer": "AM0PR01MB0001 (15.20.8100.10)",
  "TokenObjectId": "00000000-0000-0000-0000-0000000a11ce",
  "TokenTenantId": "00000000-0000-0000-0000-00000000c0de",
  "MailboxOwnerUPN": "j.doe@corp.example.com",
  "MailboxGuid": "00000000-0000-0000-0000-0000000b0b01",
  "ClientInfoString": "Client=OWA",
  "SessionId": "00000000-0000-0000-0000-000000005e55",
  "Parameters": [
    {
      "Name": "Name",
      "Value": "Invoice notices"
    },
    {
      "Name": "SubjectOrBodyContainsWords",
      "Value": "invoice;payment"
    },
    {
      "Name": "MoveToFolder",
      "Value": "\\RSS Feeds"
    },
    {
      "Name": "MarkAsRead",
      "Value": "True"
    }
  ]
}

Attacks this event reveals

Detection rules that read this event:

Frequently asked questions

Why do I not see New-InboxRule for rules users create in Outlook?

Rules created in the Outlook desktop client are recorded as the mailbox audit action UpdateInboxRules. New-InboxRule covers Outlook on the web and PowerShell.

Does a forwarding rule mean mail left the organization?

Not necessarily. With automatic external forwarding disabled in the outbound spam policy (the default for new organizations since 2021), forwarding to external recipients fails with a non-delivery report. The rule still exists.

References