Skip to main content

Microsoft Defender for Office 365 Integration Guide

Overview

The Microsoft Defender for Office 365 (MDO365) integration connects your NINA workflows to two distinct Microsoft APIs:

  1. Microsoft Graph Security API — alerts, incidents, secure scores, advanced hunting, and threat submissions
  2. Exchange Online Admin REST API — email security policy configuration via two transport layers:
    • OData endpoint (/EntitySet): Safe Links, Anti-Phishing, Anti-Spam, Anti-Malware rules, Mailbox Junk settings
    • InvokeCommand endpoint (POST /InvokeCommand): Safe Attachment policies, Malware Filter policies, outbound spam, quarantine, allow/block lists, protection policy rules, reporting cmdlets, and more

This integration lets you monitor and respond to email-borne threats, manage anti-phishing and anti-spam policies, query hunting data across mailflow events, submit suspicious messages and URLs for analysis, and audit changes across your Exchange Online security posture — all directly from your workflows.

Microsoft Defender for Office 365 is Microsoft's cloud-based email filtering and threat protection service layered on top of Exchange Online Protection (EOP). Plan 1 adds Safe Attachments, Safe Links, and ATP anti-phishing. Plan 2 adds threat trackers, attack simulators, advanced hunting, and automated investigation and response (AIR).

Resources at a Glance

GroupResourceAPI Used
Graph SecurityalertGraph Security API
Graph SecurityincidentGraph Security API
Graph SecuritysecureScoreGraph Security API
Graph SecuritysecureScoreControlProfileGraph Security API
Graph SecurityadvancedHuntingGraph Security API
Graph Security (Advanced Hunting tables)emailEvents, emailAttachmentInfo, emailUrlInfo, emailPostDeliveryEvents, cloudAppEvents, alertInfo, alertEvidenceGraph Security API
Threat Submissions (Plan 2)emailThreatSubmission, urlThreatSubmission, fileThreatSubmissionGraph Security API
Exchange Online Policy (OData)safeAttachmentRule, atpPolicyForO365EXO Admin API (OData)
Exchange Online Policy (OData)safeLinksPolicy, safeLinksRuleEXO Admin API (OData)
Exchange Online Policy (OData)antiPhishPolicy, antiPhishRuleEXO Admin API (OData)
Exchange Online Policy (OData)hostedContentFilterPolicy, hostedContentFilterRuleEXO Admin API (OData)
Exchange Online Policy (OData)malwareFilterRuleEXO Admin API (OData)
Exchange Online Policy (OData)mailboxJunkEmailConfigurationEXO Admin API (OData)
Exchange Online Policy (IC)safeAttachmentPolicy, malwareFilterPolicyEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)hostedOutboundSpamFilterPolicy, hostedOutboundSpamFilterRuleEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)hostedConnectionFilterPolicyEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)blockedSenderAddressEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)quarantinePolicy, quarantineMessageEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)tenantAllowBlockListItems, tenantAllowBlockListSpoofItemsEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)eopProtectionPolicyRule, atpProtectionPolicyRuleEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)teamsProtectionPolicy, teamsProtectionPolicyRuleEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)reportSubmissionPolicy, reportSubmissionRuleEXO Admin API (InvokeCommand)
Exchange Online Policy (IC)protectionAlert, emailTenantSettingsEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)mailTrafficATPReport, mailDetailATPReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)safeLinksAggregateReport, safeLinksDetailReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)contentMalwareMdoAggregateReport, contentMalwareMdoDetailReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)mailFlowStatusReport, mailTrafficSummaryReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)compromisedUserAggregateReport, compromisedUserDetailReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)spoofMailReport, aggregateZapReport, detailZapReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)mailTrafficPolicyReport, mailDetailTransportRuleReportEXO Admin API (InvokeCommand)
Exchange Online Reports (IC)spoofIntelligenceInsightEXO Admin API (InvokeCommand)
Exchange Online AuditunifiedAuditLogEXO Admin API (OData)
Exchange Online ManagementpriorityAccountUserEXO Admin API (OData)

Resources that require Defender for Office 365 Plan 2 (emailThreatSubmission, urlThreatSubmission, fileThreatSubmission) are compiled and dispatched correctly but will return an error if your tenant does not have the required license. See the License Requirements section.

InvokeCommand (IC) resources use the POST /InvokeCommand endpoint rather than OData entity sets. They use the same EXO bearer token and require the same Exchange.ManageAsApp permission and Exchange Administrator role. No additional configuration is needed.


License Requirements

Licensing requirements apply at the tenant level — the Microsoft 365 subscription must include (or have add-on access to) the relevant plan. User-level licensing may also be required for policies that protect specific mailboxes.

ResourceMinimum License Required
alert, incident, secureScore, secureScoreControlProfileMicrosoft Defender for Office 365 Plan 1 or Plan 2 (included in Microsoft 365 E5, Microsoft 365 Business Premium, or as a standalone add-on)
advancedHunting (all Advanced Hunting tables)Microsoft Defender for Office 365 Plan 2 (included in Microsoft 365 E5 or standalone Plan 2)
emailThreatSubmission, urlThreatSubmission, fileThreatSubmissionMicrosoft Defender for Office 365 Plan 2
safeAttachmentRule, atpPolicyForO365Microsoft Defender for Office 365 Plan 1 or Plan 2
safeAttachmentPolicyMicrosoft Defender for Office 365 Plan 1 or Plan 2
safeLinksPolicy, safeLinksRuleMicrosoft Defender for Office 365 Plan 1 or Plan 2
antiPhishPolicy, antiPhishRuleMicrosoft Defender for Office 365 Plan 1 or Plan 2 (EOP includes basic anti-phishing; ATP impersonation protection requires Plan 1+)
hostedContentFilterPolicy, hostedContentFilterRuleExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
malwareFilterRule, malwareFilterPolicyExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
hostedOutboundSpamFilterPolicy, hostedOutboundSpamFilterRuleExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
hostedConnectionFilterPolicy, blockedSenderAddressExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
quarantinePolicy, quarantineMessageExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
tenantAllowBlockListItems, tenantAllowBlockListSpoofItemsExchange Online Protection (EOP) — included in all Exchange Online/Microsoft 365 plans
eopProtectionPolicyRule, atpProtectionPolicyRuleMicrosoft Defender for Office 365 Plan 1 or Plan 2
teamsProtectionPolicy, teamsProtectionPolicyRuleMicrosoft Defender for Office 365 Plan 1 or Plan 2
reportSubmissionPolicy, reportSubmissionRuleExchange Online — any plan that includes Exchange Online
protectionAlertMicrosoft Defender for Office 365 Plan 1 or Plan 2
emailTenantSettingsExchange Online — any plan that includes Exchange Online
All report resources (mailTrafficATPReport, etc.)Microsoft Defender for Office 365 Plan 1 or Plan 2 (ATP reports); EOP (flow/status reports)
mailboxJunkEmailConfigurationExchange Online — any plan that includes Exchange Online
unifiedAuditLogExchange Online — Unified Audit Log must be enabled in the Microsoft 365 compliance center
priorityAccountUserMicrosoft 365 E3, E5, or Business Premium (Priority Account is a premium feature)

Confirming your plan: In the Microsoft 365 admin center, go to Billing > Your products and verify that you have a Defender for Office 365 Plan 1 or Plan 2 subscription (or a bundle that includes it, such as Microsoft 365 E5).


Credential Configuration

This integration requires a single Azure App Registration. The app authenticates against two separate APIs using distinct OAuth2 token scopes — the integration handles token acquisition and caching for both automatically.

APIToken endpointScope
Microsoft Graphhttps://login.microsoftonline.com/{tenantId}/oauth2/v2.0/tokenhttps://graph.microsoft.com/.default
Exchange Online Adminhttps://login.microsoftonline.com/{tenantId}/oauth2/v2.0/tokenhttps://outlook.office365.com/.default

Authentication Method

OAuth2 Client Credentials

FieldDescriptionExample
Tenant IDDirectory (tenant) ID from Azure portal87654321-4321-4321-4321-fedcba987654
Client IDApplication (client) ID from the App Registration12345678-1234-1234-1234-123456789abc
Client SecretClient secret valueabcd1234~efgh5678ijklMNOP9012qrst.UV
Base URLGraph API base URL. Change only for sovereign cloud.https://graph.microsoft.com/v1.0

Creating the Azure App Registration

  1. Sign in to the Azure portal
  2. Navigate to Microsoft Entra ID > App registrations
  3. Click New registration
  4. Provide a name (e.g., "NINA MDO365 Integration")
  5. Select Accounts in this organizational directory only
  6. Click Register
  7. Note the Application (client) ID and Directory (tenant) ID from the overview page
  8. Go to Certificates & secrets > Client secrets > New client secret
  9. Enter a description and expiration period, then click Add
  10. Copy the Value immediately — it will not be shown again

Required API Permissions

Microsoft Graph (Application permissions)

Grant the following and click Grant admin consent:

PermissionRequired forRequired operations
SecurityAlert.Read.AllReading alertsalert.list, alert.get
SecurityAlert.ReadWrite.AllUpdating alertsalert.update
SecurityIncident.Read.AllReading incidentsincident.list, incident.get, incident.listAlerts
SecurityIncident.ReadWrite.AllUpdating incidentsincident.update
SecurityEvents.Read.AllReading secure scoressecureScore.list, secureScore.get, secureScoreControlProfile.list, secureScoreControlProfile.get
ThreatHunting.Read.AllAdvanced hunting queriesAll advancedHunting.*, emailEvents.*, emailAttachmentInfo.*, emailUrlInfo.*, emailPostDeliveryEvents.*, cloudAppEvents.*, alertInfo.*, alertEvidence.*
ThreatSubmission.Read.AllReading threat submissionsemailThreatSubmission.list, emailThreatSubmission.get, urlThreatSubmission.list, urlThreatSubmission.get, fileThreatSubmission.list, fileThreatSubmission.get
ThreatSubmission.ReadWrite.AllSubmitting threats for analysisemailThreatSubmission.create, emailThreatSubmission.review, urlThreatSubmission.create, fileThreatSubmission.create

Note: SecurityEvents.Read.All is a broad permission that also covers alerts and incidents. If you prefer finer-grained control, use SecurityAlert.Read.All and SecurityIncident.Read.All separately instead.

Exchange Online Admin API (Application permissions)

In API permissions, click Add a permission > APIs my organization uses > search for Office 365 Exchange Online:

PermissionDescription
Exchange.ManageAsAppAllows the application to manage Exchange Online as a service account, required for all EXO Admin API calls

Important: After granting Exchange.ManageAsApp, you must also assign the Azure AD role Exchange Administrator (or a more scoped role) to the service principal. This is done in Microsoft Entra ID > Roles and administrators > Exchange administrator > Add assignments.

Assigning the Exchange Administrator Role

  1. In the Azure portal, go to Microsoft Entra ID > Roles and administrators
  2. Search for and open Exchange administrator
  3. Click Add assignments
  4. Search for your App Registration by name, select it, and click Add

The service principal must have this role — Exchange.ManageAsApp alone is not sufficient without it.

Creating a Microsoft Defender for Office 365 Credential in NINA

  1. Navigate to the Credentials section in NINA
  2. Click Add New Credential
  3. Fill in:
    • Name: A descriptive name (e.g., "MDO365 Production")
    • Integration Service: Select "Microsoft Defender for Office 365"
    • Auth Type: Select "OAuth2"
    • Tenant ID: Your Directory (tenant) ID
    • Client ID: Your Application (client) ID
    • Client Secret: Your client secret value
    • Base URL: Leave blank for commercial cloud
  4. Click Test Connection to verify credentials
  5. Click Save

Sovereign Cloud Environments

CloudGraph Base URL
Commercial (default)https://graph.microsoft.com/v1.0
US Government GCChttps://graph.microsoft.us/v1.0
US Government GCC Highhttps://dod-graph.microsoft.us/v1.0

The Exchange Online Admin API base URL (https://outlook.office365.com/adminapi/beta/{tenantId}/) does not vary by sovereign cloud in the current implementation.


Supported Resources and Operations

Alert

Manage MDO365 security alerts via the Microsoft Graph Security API. Use serviceSource eq 'microsoftDefenderForOffice365' in $filter to scope results to MDO365 only.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: SecurityAlert.Read.All (read), SecurityAlert.ReadWrite.All (update)

OperationDescription
listRetrieve security alerts with OData filtering, sorting, and shortcuts
getRetrieve a single alert by ID
updateUpdate status, classification, determination, assignee, or add a comment

Key parameters for list:

  • $filter — OData filter (e.g., serviceSource eq 'microsoftDefenderForOffice365' and severity eq 'high')
  • $top — max results (default: 50, max: 2000)
  • $skip — pagination offset
  • $orderby — sort expression (e.g., createdDateTime desc)
  • severity — shortcut: unknown, informational, low, medium, high
  • status — shortcut: unknown, new, inProgress, resolved
  • serviceSource — shortcut: microsoftDefenderForOffice365

Key parameters for update:

  • alertId (required) — the alert ID
  • updateFields.statusnew, inProgress, resolved
  • updateFields.classificationunknown, truePositive, informationalExpectedActivity, falsePositive
  • updateFields.determinationunknown, apt, malware, securityPersonnel, securityTesting, unwantedSoftware, other, multiStagedAttack, compromisedUser, phishing, maliciousUserActivity, notMalicious, notEnoughDataToValidate, confirmedUserActivity, lineOfBusinessApplication
  • updateFields.assignedTo — analyst email address
  • updateFields.comment — comment text to append

Incident

Query and update MDO365 security incidents, which group related alerts into a single investigation case.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: SecurityIncident.Read.All (read), SecurityIncident.ReadWrite.All (update)

OperationDescription
listRetrieve incidents with OData filtering
getRetrieve a single incident by ID
updateUpdate status, classification, determination, or assignment
listAlertsRetrieve all alerts associated with an incident

Key parameters for list:

  • $filter — OData filter (e.g., status eq 'active')
  • $top — max results (default: 50)
  • $skip — pagination offset
  • $orderby — sort expression
  • status — shortcut: active, resolved, inProgress, redirected
  • severity — shortcut: unknown, informational, low, medium, high

Key parameters for update:

  • incidentId (required) — the incident ID
  • updateFields.statusactive, resolved, inProgress, redirected
  • updateFields.assignedTo — analyst UPN
  • updateFields.classificationunknown, falsePositive, truePositive, informationalExpectedActivity
  • updateFields.determination — same values as alert determination
  • updateFields.tags — array of string tags

Secure Score

Retrieve the organization's Microsoft Secure Score for identity and threat protection.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: SecurityEvents.Read.All

OperationDescription
listRetrieve historical secure score snapshots
getRetrieve a specific secure score snapshot by ID

Key parameters for list:

  • $top — max snapshots (default: 10)
  • $filter — OData filter expression

Secure Score Control Profile

Retrieve the control profiles that make up the secure score.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: SecurityEvents.Read.All

OperationDescription
listRetrieve all secure score control profiles
getRetrieve a specific control profile by ID

Key parameters for list:

  • $filter — OData filter expression
  • $top — max results (default: 100)

Advanced Hunting

Execute KQL (Kusto Query Language) queries across MDO365 hunting tables via the Microsoft Graph runHuntingQuery API. All Advanced Hunting resources share the same query operation.

Minimum license: Microsoft Defender for Office 365 Plan 2 Required permissions: ThreatHunting.Read.All

ResourceTableKey columns
advancedHuntingGeneric — provide any valid MDO365 KQL queryN/A
emailEventsEmailEventsNetworkMessageId, SenderFromAddress, RecipientEmailAddress, Subject, ThreatNames, DeliveryAction
emailAttachmentInfoEmailAttachmentInfoNetworkMessageId, FileName, FileType, SHA256, ThreatNames
emailUrlInfoEmailUrlInfoNetworkMessageId, Url, UrlDomain
emailPostDeliveryEventsEmailPostDeliveryEventsNetworkMessageId, RecipientEmailAddress, ActionType, ActionResult
cloudAppEventsCloudAppEventsAccountDisplayName, AccountObjectId, Application, ActionType, IPAddress
alertInfoAlertInfoAlertId, Title, Category, Severity, ServiceSource, DetectionSource
alertEvidenceAlertEvidenceAlertId, EntityType, RemoteIP, AccountName, FileName, ProcessCommandLine

Common parameters for all query operations:

  • query — full KQL query; if omitted, a default TABLE | take N query is built from $top and timeRange
  • $top — max rows (default: 25); appended as | take N when no query is provided
  • timeRange — look-back in days; appended as | where Timestamp > ago(Nd) when no query is provided
  • timeoutInSeconds — max query execution time in seconds

When you provide a query, the table name is automatically prepended if not already present at the start of the query.


Email Threat Submission

Submit and manage email messages reported as threats to Microsoft for analysis.

Minimum license: Microsoft Defender for Office 365 Plan 2 Required permissions: ThreatSubmission.Read.All (list/get), ThreatSubmission.ReadWrite.All (create/review)

OperationDescription
listRetrieve email threat submissions with filtering
getRetrieve a specific submission by ID
createSubmit an email message for threat analysis
reviewRequest a review of an existing submission

Key parameters for create:

  • category (required) — notJunk, spam, phishing, malware
  • recipientEmailAddress (required) — recipient who received the message
  • networkMessageId — message ID from X-MS-Exchange-Organization-Network-Message-Id header
  • sender — sender email address
  • senderIp — sender IP address
  • subject — email subject
  • messageDateTime — receipt time (RFC3339)

Rate limit: 150 submissions per 15 minutes.


URL Threat Submission

Submit URLs reported as threats to Microsoft for analysis.

Minimum license: Microsoft Defender for Office 365 Plan 2 Required permissions: ThreatSubmission.Read.All (list/get), ThreatSubmission.ReadWrite.All (create)

OperationDescription
listRetrieve URL threat submissions
getRetrieve a specific submission by ID
createSubmit a URL for threat analysis

Key parameters for create:

  • category (required) — notJunk, spam, phishing, malware
  • webUrl (required) — the URL to submit (e.g., https://example.com/suspicious-page)

File Threat Submission

Submit files reported as threats to Microsoft for analysis.

Minimum license: Microsoft Defender for Office 365 Plan 2 Required permissions: ThreatSubmission.Read.All (list/get), ThreatSubmission.ReadWrite.All (create)

OperationDescription
listRetrieve file threat submissions
getRetrieve a specific submission by ID
createSubmit a file for threat analysis

Key parameters for create:

  • category (required) — notJunk, spam, phishing, malware
  • fileName (required) — the file name (e.g., suspicious.exe)
  • fileContent (required) — the base64-encoded content of the file

Safe Attachment Rule

Manage Safe Attachments rules via the Exchange Online Admin API. Rules define the recipient scope (users, groups, domains) and link to a Safe Attachments policy.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all Safe Attachment rules
getGet a rule by name or GUID
createCreate a rule and link it to an existing policy
updateUpdate rule filters or priority
deleteDelete a rule
enableEnable a disabled rule
disableDisable an enabled rule

Key parameters for create:

  • name (required) — unique rule name
  • safeAttachmentPolicy (required) — name of the policy to link to
  • recipientDomainIs — comma-separated recipient domains
  • sentTo — comma-separated recipient addresses
  • sentToMemberOf — group names or email addresses
  • priority — rule evaluation order (lower number = higher priority)

Key parameters for update:

  • identity (required) — name or GUID of the rule

Safe Attachment Policy

Manage Safe Attachments policies via the EXO InvokeCommand endpoint. Policies define the scanning action applied to email attachments (Allow, Block, DynamicDelivery). Each policy is linked to one or more safeAttachmentRule rules that define the recipient scope.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all Safe Attachment policies
getGet a policy by name
createCreate a new policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • actionAllow, Block, DynamicDelivery
  • quarantineTag — quarantine policy to apply to blocked attachments
  • redirect — boolean; redirect attachments to an admin address on scan error
  • redirectAddress — admin email for redirection
  • actionOnError — boolean; apply the action even if scanning fails
  • adminDisplayName — optional description

ATP Policy for Office 365

Retrieve and update the singleton ATP policy that controls Safe Attachments for SharePoint, OneDrive, and Microsoft Teams.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve the singleton ATP policy
updateUpdate Safe Docs and related settings

Key parameters for update:

  • enableSafeDocs — boolean; enable Safe Documents for Office clients
  • enableATPForSPOTeamsODB — boolean; enable Safe Attachments for SharePoint, OneDrive, and Teams
  • enableSafeLinksForO365Clients — boolean; enable Safe Links in Office 365 clients

Manage Safe Links policies, which define URL rewriting and click-protection behavior.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all Safe Links policies
getGet a policy by name
createCreate a new Safe Links policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • enableSafeLinksForEmail — boolean; enable URL rewriting in email
  • enableSafeLinksForTeams — boolean; enable Safe Links in Teams
  • enableSafeLinksForOffice — boolean; enable Safe Links in Office apps
  • trackClicks — boolean; track user clicks on URLs
  • allowClickThrough — boolean; let users bypass blocked URLs
  • scanUrls — boolean; enable real-time URL scanning before delivery
  • enableForInternalSenders — boolean; apply policy to internal senders

Manage Safe Links rules that specify recipient scope and link to a Safe Links policy.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all Safe Links rules
getGet a rule by name
createCreate a rule
updateUpdate rule filters or priority
deleteDelete a rule
enableEnable a rule
disableDisable a rule

Key parameters for list:

  • state — shortcut: Enabled, Disabled
  • $filter — OData filter (takes precedence over state)
  • $top — max results

Anti-Phishing Policy

Manage ATP anti-phishing policies, which configure impersonation protection, spoof intelligence, and mailbox intelligence.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 (EOP includes basic anti-phishing; impersonation and advanced features require Plan 1+) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all anti-phishing policies
getGet a policy by name
createCreate a new policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • enableAntiSpoofEnforcement — boolean; enable spoof intelligence enforcement
  • enableMailboxIntelligence — boolean; enable mailbox intelligence
  • enableMailboxIntelligenceProtection — boolean; enable action on mailbox intelligence signals
  • enableTargetedUserProtection — boolean; enable targeted user impersonation protection
  • targetedUsersToProtect — array of name;email pairs to protect
  • enableOrganizationDomainsProtection — boolean; protect organization's own domains
  • enableTargetedDomainsProtection — boolean; enable targeted domain impersonation protection
  • targetedDomainsToProtect — array of domain names

Anti-Phishing Rule

Manage anti-phishing rules that define recipient scope for anti-phishing policies.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all anti-phishing rules
getGet a rule by name
createCreate a rule
updateUpdate filters or priority
deleteDelete a rule
enableEnable a rule
disableDisable a rule

Hosted Content Filter Policy (Anti-Spam)

Manage inbound anti-spam (content filter) policies, which define spam and bulk-mail thresholds and actions.

Minimum license: Exchange Online Protection (EOP) — no Defender plan required Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all anti-spam policies
getGet a policy by name
createCreate a policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • spamAction — action for spam: MoveToJmf, AddXHeader, ModifySubject, Redirect, Delete, Quarantine
  • highConfidenceSpamAction — action for high-confidence spam (same values)
  • phishSpamAction — action for phish: MoveToJmf, Redirect, Delete, Quarantine
  • bulkThreshold — bulk complaint level threshold (1–9, lower = more aggressive)
  • zAPEnabled — boolean; enable Zero-hour Auto Purge
  • quarantineTag — quarantine policy name to apply

Hosted Content Filter Rule (Anti-Spam Rule)

Manage anti-spam rules that link policies to recipient scopes.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all anti-spam rules
getGet a rule by name
createCreate a rule
updateUpdate filters or priority
deleteDelete a rule
enableEnable a rule
disableDisable a rule

Key parameters for list:

  • state — shortcut: Enabled, Disabled
  • $filter — OData filter

Malware Filter Rule (Anti-Malware Rule)

Manage anti-malware rules that link malware filter policies to recipient scopes.

Minimum license: Exchange Online Protection (EOP) — no Defender plan required Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all malware filter rules
getGet a rule by name
createCreate a rule
updateUpdate filters or priority
deleteDelete a rule
enableEnable a rule
disableDisable a rule

Malware Filter Policy (Anti-Malware Policy)

Manage anti-malware policies via the EXO InvokeCommand endpoint. Policies define the action to take on detected malware and configure admin notifications.

Minimum license: Exchange Online Protection (EOP) — no Defender plan required Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all malware filter policies
getGet a policy by name
createCreate a policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • actionDeleteMessage, DeleteAttachmentAndUseDefaultAlertText, DeleteAttachmentAndUseCustomAlertText
  • enableFileFilter — boolean; enable common attachments filter
  • fileTypes — comma-separated list of blocked file extensions
  • zAPEnabled — boolean; enable Zero-hour Auto Purge for malware
  • enableInternalSenderAdminNotifications — boolean; send admin notifications for internal senders
  • internalSenderAdminAddress — admin email for internal notifications
  • enableExternalSenderAdminNotifications — boolean
  • externalSenderAdminAddress — admin email for external notifications

Hosted Outbound Spam Filter Policy

Manage outbound spam filter policies via the EXO InvokeCommand endpoint. These policies control per-user sending limits and the action taken when a user exceeds those limits.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all outbound spam filter policies
getGet a policy by name
createCreate a policy
updateUpdate policy settings
deleteDelete a policy

Key parameters for create:

  • name (required) — unique policy name
  • recipientLimitExternalPerHour — max external recipients per hour (0 = unlimited)
  • recipientLimitInternalPerHour — max internal recipients per hour
  • recipientLimitPerDay — max recipients per day
  • actionWhenThresholdReachedAlert, BlockUser, BlockMessageAndNotifyUser

Hosted Outbound Spam Filter Rule

Manage outbound spam filter rules that link policies to sender scopes.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all outbound spam filter rules
getGet a rule by name
createCreate a rule
updateUpdate rule settings
deleteDelete a rule

Hosted Connection Filter Policy

Retrieve and update the connection filter policy (IP Allow/Block lists). This is a tenant-wide singleton — only one exists per organization.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve the singleton connection filter policy
updateUpdate IP allow/block lists

Key parameters for update:

  • ipAllowList — comma-separated list of allowed IP addresses/CIDR ranges
  • ipBlockList — comma-separated list of blocked IP addresses/CIDR ranges
  • enableSafeList — boolean; enable Microsoft's Safe List (automatic reputation-based bypass)

Blocked Sender Address

List and unblock users who have been restricted from sending outbound mail (typically due to compromised account detection or exceeding send limits).

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all restricted (blocked) sender addresses
getGet a specific blocked sender by address
deleteRemove a sender from the blocked list (unblock)

Key parameters for get / delete:

  • senderAddress (required) — the email address to look up or unblock

Quarantine Policy

Manage quarantine policies that define what end users can do with their quarantined messages.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all quarantine policies
getGet a policy by name
createCreate a quarantine policy
updateGlobalUpdate the global quarantine policy settings
deleteDelete a quarantine policy

Key parameters for create:

  • name (required) — unique policy name
  • endUserQuarantinePermissionsValue — permission bitmask (0–236)
  • eSNEnabled — boolean; enable end-user spam notifications
  • multiLanguageSetting — notification language(s)
  • endUserSpamNotificationFrequency — notification frequency in days

Quarantine Message

Query and manage messages currently held in the Exchange Online quarantine.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList quarantined messages with filtering
getGet a specific quarantined message by identity
releaseRelease one or more messages from quarantine
deleteDelete one or more quarantined messages

Key parameters for list:

  • $top — max results
  • startReceivedDate, endReceivedDate — date range filter
  • senderAddress, recipientAddress — sender/recipient filter
  • typeSpam, Malware, Phish, Bulk, etc.

Key parameters for release / delete:

  • identities (required) — comma-separated list of quarantine message IDs

Tenant Allow/Block List Items

Manage organization-level entries in the Tenant Allow/Block List for URLs, file hashes, sender addresses, and IP addresses.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList entries (requires listType)
getGet a specific entry by identity
createCreate allow or block entries
updateUpdate existing entries
deleteDelete entries

Key parameters for list / create:

  • listType (required for list/create) — Url, FileHash, Sender, IP
  • entries (required for create) — comma-separated list of values to add
  • actionAllow or Block
  • expirationDate — expiry date (ISO 8601) or use noExpiration: true
  • notes — optional note

Tenant Allow/Block List Spoof Items

Manage allow/block entries for spoofed sender/infrastructure pairs used by spoof intelligence.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all spoof items
getGet a spoof item by identity
createCreate a spoof allow or block entry
updateUpdate an entry
deleteDelete an entry

Key parameters for create:

  • spoofedUser (required) — spoofed sender domain or email
  • sendingInfrastructure (required) — sending IP or domain
  • spoofTypeInternal or External
  • actionAllow or Block

EOP Protection Policy Rule

Manage EOP preset security policy rules (Standard/Strict) that bundle anti-spam, anti-malware, and anti-phishing policies into a single scoped assignment.

Minimum license: Exchange Online Protection (EOP) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all EOP protection policy rules
getGet a rule by name
createCreate a rule
updateUpdate rule settings
enableEnable a rule
disableDisable a rule

Key parameters for create:

  • name (required) — unique rule name
  • antiSpamPolicy, antiMalwarePolicy, antiPhishPolicy — linked policy names
  • sentTo, sentToMemberOf, recipientDomainIs — recipient conditions
  • exceptIfSentTo, exceptIfSentToMemberOf, exceptIfRecipientDomainIs — exclusions
  • priority — rule evaluation order

ATP Protection Policy Rule

Manage ATP preset security policy rules (Standard/Strict) that bundle Safe Attachments and Safe Links into a single scoped assignment.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all ATP protection policy rules
getGet a rule by name
createCreate a rule
updateUpdate rule settings
enableEnable a rule
disableDisable a rule

Key parameters: same as eopProtectionPolicyRule with safeAttachmentPolicy and safeLinksPolicy instead of EOP-specific policy names.


Teams Protection Policy

Retrieve and update the singleton Teams protection policy that controls Safe Attachments and Safe Links enforcement for Microsoft Teams messages.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve the singleton Teams protection policy
createCreate the policy (if not yet provisioned)
updateUpdate Safe Links / Safe Attachments settings

Key parameters for update:

  • enableSafeLinks — boolean
  • enableSafeAttachments — boolean
  • zAPEnabled — boolean; enable Zero-hour Auto Purge for Teams messages

Teams Protection Policy Rule

Manage Teams protection policy rules that apply the Teams protection policy to specific recipients.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all Teams protection policy rules
getGet a rule by name
createCreate a rule
updateUpdate rule settings

Key parameters for create:

  • name (required) — unique rule name
  • teamsProtectionPolicy (required) — name of the Teams protection policy to link
  • sentTo, sentToMemberOf, recipientDomainIs — recipient conditions
  • exceptIfSentTo, exceptIfSentToMemberOf, exceptIfRecipientDomainIs — exclusions
  • priority — rule evaluation order

Report Submission Policy

Retrieve and manage the report submission policy (singleton) that controls how users report messages in Outlook and how admin notifications are configured.

Minimum license: Exchange Online Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve the singleton report submission policy
createCreate the policy (if not yet provisioned)
updateUpdate policy settings
deleteDelete the policy

Key parameters for update:

  • enableReportToMicrosoft — boolean; allow users to report to Microsoft
  • enableUserEmailNotification — boolean; send email notification to users after admin review
  • reportJunkAddresses, reportNotJunkAddresses, reportPhishAddresses — admin mailboxes for each type

Report Submission Rule

Manage report submission rules that route user-reported messages to specific mailboxes.

Minimum license: Exchange Online Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all report submission rules
getGet a rule by name
createCreate a rule
updateUpdate rule settings
enableEnable a rule
disableDisable a rule
deleteDelete a rule

Key parameters for create:

  • name (required) — unique rule name
  • reportSubmissionPolicy (required) — name of the linked policy
  • sentTo — destination mailbox for reported messages

Protection Alert

Manage custom alert policies in the Microsoft 365 Defender portal.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
listList all protection alerts
getGet an alert policy by name
createCreate a custom alert policy

Key parameters for create:

  • name (required) — unique alert name
  • description — alert description
  • category — alert category
  • threatType — type of threat that triggers the alert
  • operation — array of operations to monitor
  • notifyUser — array of email addresses to notify
  • aggregationType — how to group alerts

Email Tenant Settings

Retrieve and update tenant-wide email security settings (singleton).

Minimum license: Exchange Online Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve the singleton email tenant settings
updateUpdate tenant-wide settings

Key parameters for update:

  • enablePriorityAccountProtection — boolean; enable enhanced monitoring for priority accounts

EXO Report Resources

All EXO report resources use the InvokeCommand endpoint and support list only. They accept optional date range and filter parameters.

Minimum license: Microsoft Defender for Office 365 Plan 1 or Plan 2 (ATP reports); EOP for flow/status reports Required permissions: Exchange.ManageAsApp + Exchange Administrator role

Common parameters for all report list operations:

  • startDate — report start date (ISO 8601)
  • endDate — report end date (ISO 8601)
  • domain — filter by domain (where supported)
  • directionInbound or Outbound (where supported)
ResourcePowerShell cmdletDescription
mailTrafficATPReportGet-MailTrafficATPReportPer-day mail traffic summary with ATP verdicts
mailDetailATPReportGet-MailDetailATPReportPer-message ATP verdict details
safeLinksAggregateReportGet-SafeLinksAggregateReportAggregate Safe Links URL click statistics
safeLinksDetailReportGet-SafeLinksDetailReportPer-URL Safe Links click details
contentMalwareMdoAggregateReportGet-ContentMalwareMdoAggregateReportAggregate malware detected in SharePoint/OneDrive/Teams
contentMalwareMdoDetailReportGet-ContentMalwareMdoDetailReportPer-file malware details in SharePoint/OneDrive/Teams
mailFlowStatusReportGet-MailFlowStatusReportDaily summary of mail flow by status
mailTrafficSummaryReportGet-MailTrafficSummaryReportSummary mail traffic statistics
compromisedUserAggregateReportGet-CompromisedUserAggregateReportDaily count of compromised user accounts
compromisedUserDetailReportGet-CompromisedUserDetailReportPer-user compromised account details
spoofMailReportGet-SpoofMailReportSummary of spoofed mail
aggregateZapReportGet-AggregateZapReportAggregate Zero-hour Auto Purge statistics
detailZapReportGet-DetailZapReportPer-message ZAP action details
mailTrafficPolicyReportGet-MailTrafficPolicyReportMail traffic broken down by policy
mailDetailTransportRuleReportGet-MailDetailTransportRuleReportPer-message transport rule match details
spoofIntelligenceInsightGet-SpoofIntelligenceInsightSpoof intelligence insights and allow/block decisions

Mailbox Junk Email Configuration

Read and configure the per-mailbox junk email settings, including trusted senders, blocked senders, and contact trust.

Minimum license: Exchange Online (any plan) Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
getRetrieve junk email settings for a specific mailbox
updateUpdate junk email settings

Key parameters for get:

  • identity (required) — mailbox identity (UPN, email address, or GUID)

Key parameters for update:

  • identity (required) — mailbox identity
  • contactsTrusted — boolean; trust all contacts as senders
  • trustedSendersAndDomains — array of trusted sender addresses or domains
  • blockedSendersAndDomains — array of blocked sender addresses or domains

Priority Account User

Mark or unmark a mailbox user as a Priority Account, which enables enhanced monitoring and faster threat signals.

Minimum license: Microsoft 365 E3, E5, or Business Premium Required permissions: Exchange.ManageAsApp + Exchange Administrator role

OperationDescription
updateSet or clear Priority Account status for a user

Key parameters:

  • identity (required) — user UPN or email address
  • isPriorityAccount (required) — boolean; true to tag as a priority account, false to untag

Unified Audit Log

Search the Exchange Online Unified Audit Log for security and compliance events.

Minimum license: Exchange Online — Unified Audit Log must be enabled (default in Microsoft 365 E3/E5; must be manually enabled for standalone Exchange Online) Required permissions: Exchange.ManageAsApp + Exchange Administrator role (or Audit Logs role in Exchange)

OperationDescription
searchSearch audit log events with date range and optional filters

Key parameters:

  • startDate (required) — ISO 8601 start date/time (e.g., 2026-01-01T00:00:00Z)
  • endDate (required) — ISO 8601 end date/time (e.g., 2026-01-31T23:59:59Z)
  • recordType — filter by record type (e.g., ExchangeAdmin, AzureActiveDirectory)
  • operations — comma-separated list of operations to filter on (e.g., New-TransportRule,Set-TransportRule)
  • userIds — comma-separated list of user UPNs to filter on
  • $top — max results (default: 100)

The Unified Audit Log retains data for 90 days (Microsoft 365 E3) or up to 1 year (Microsoft 365 E5). The maximum date range per query is 90 days.


Parameter Merging and Templating

Parameter Sources (in order of precedence)

  1. Node Parameters: Parameters configured directly in the MDO365 Integration Node
  2. Extracted Parameters: Parameters automatically extracted from the input data
  3. Input Data: The complete input data from upstream nodes

When an MDO365 Integration Node executes:

  • Parameters from all sources are merged
  • Node parameters take precedence over extracted parameters
  • Template variables within parameters are processed using {{variable_name}} syntax

OData Filter Shortcuts vs. Raw Filters

Several list operations provide shortcut filter parameters (e.g., severity, status) that are automatically converted to OData $filter expressions. When you provide a raw $filter parameter, shortcut parameters are ignored and the raw filter takes full precedence.

BehaviorWhen to use
Shortcut filters (severity, status, state, etc.)Simple, single-field filters — no OData syntax required
Raw $filterComplex expressions, or logic, multiple fields, or OData functions

Examples

Listing MDO365 Alerts with Service Source Filter

{
"integration_service": "microsoft-defender-office-365",
"resource": "alert",
"operation": "list",
"parameters": {
"serviceSource": "microsoftDefenderForOffice365",
"severity": "high",
"status": "new",
"$top": 50,
"$orderby": "createdDateTime desc"
}
}

Updating an Alert with Template Variables

{
"integration_service": "microsoft-defender-office-365",
"resource": "alert",
"operation": "update",
"parameters": {
"alertId": "{{alert_id}}",
"updateFields": {
"status": "inProgress",
"assignedTo": "{{analyst_email}}",
"classification": "truePositive",
"determination": "phishing",
"comment": "Confirmed phishing attempt targeting {{recipient}} — under investigation by {{analyst_email}}"
}
}
}

Retrieving an Incident and Its Alerts

{
"integration_service": "microsoft-defender-office-365",
"resource": "incident",
"operation": "get",
"parameters": {
"incidentId": "{{incident_id}}"
}
}
{
"integration_service": "microsoft-defender-office-365",
"resource": "incident",
"operation": "listAlerts",
"parameters": {
"incidentId": "{{incident_id}}"
}
}

Retrieving the Current Secure Score

{
"integration_service": "microsoft-defender-office-365",
"resource": "secureScore",
"operation": "list",
"parameters": {
"$top": 1
}
}

Getting a Specific Secure Score Snapshot by ID

{
"integration_service": "microsoft-defender-office-365",
"resource": "secureScore",
"operation": "get",
"parameters": {
"id": "{{secure_score_id}}"
}
}

Listing All Secure Score Control Profiles

{
"integration_service": "microsoft-defender-office-365",
"resource": "secureScoreControlProfile",
"operation": "list",
"parameters": {
"$top": 100
}
}

Filtering Control Profiles by Category

{
"integration_service": "microsoft-defender-office-365",
"resource": "secureScoreControlProfile",
"operation": "list",
"parameters": {
"$filter": "controlCategory eq 'Identity'"
}
}

Running an Advanced Hunting Query on Email Events

{
"integration_service": "microsoft-defender-office-365",
"resource": "emailEvents",
"operation": "query",
"parameters": {
"query": "EmailEvents | where ThreatNames has 'Phish' | where Timestamp > ago(7d) | project NetworkMessageId, SenderFromAddress, RecipientEmailAddress, Subject, DeliveryAction, ThreatNames | take 100"
}
}

Submitting a Phishing Email for Analysis

{
"integration_service": "microsoft-defender-office-365",
"resource": "emailThreatSubmission",
"operation": "create",
"parameters": {
"category": "phishing",
"recipientEmailAddress": "{{recipient}}",
"networkMessageId": "{{network_message_id}}",
"sender": "{{sender_address}}",
"subject": "{{email_subject}}"
}
}
{
"integration_service": "microsoft-defender-office-365",
"resource": "safeLinksRule",
"operation": "enable",
"parameters": {
"identity": "{{rule_name}}"
}
}

Listing Anti-Spam Rules Filtered by State

{
"integration_service": "microsoft-defender-office-365",
"resource": "hostedContentFilterRule",
"operation": "list",
"parameters": {
"state": "Enabled"
}
}

Searching the Audit Log for Admin Changes

{
"integration_service": "microsoft-defender-office-365",
"resource": "unifiedAuditLog",
"operation": "search",
"parameters": {
"startDate": "2026-06-01T00:00:00Z",
"endDate": "2026-06-04T23:59:59Z",
"operations": "New-SafeLinksPolicy,Set-SafeLinksPolicy,Remove-SafeLinksPolicy",
"$top": 200
}
}

Tagging a User as a Priority Account

{
"integration_service": "microsoft-defender-office-365",
"resource": "priorityAccountUser",
"operation": "update",
"parameters": {
"identity": "[email protected]",
"isPriorityAccount": true
}
}

Common Workflow Patterns

Phishing Alert Triage

  1. alert.list with serviceSource=microsoftDefenderForOffice365 and severity=high — retrieve new MDO365 alerts
  2. emailEvents.query — search for emails with matching sender or subject in the last 24 hours
  3. emailThreatSubmission.create — submit confirmed phishing messages for Microsoft analysis
  4. alert.update — assign and set status to inProgress
  5. incident.update — resolve the incident once remediation is confirmed

Policy Compliance Audit

  1. safeLinksPolicy.list — enumerate all Safe Links policies
  2. safeLinksRule.list — verify all rules are enabled and cover expected recipient domains
  3. antiPhishPolicy.list — enumerate anti-phishing policies
  4. hostedContentFilterPolicy.list — verify anti-spam thresholds
  5. unifiedAuditLog.search — retrieve recent admin changes to policies for change tracking

Threat Hunting: Suspicious Email Delivery

  1. emailEvents.query — hunt for emails with unusual delivery actions or threat names
  2. emailAttachmentInfo.query — identify attachments by SHA256 or file type
  3. emailUrlInfo.query — surface suspicious URLs from email messages
  4. emailPostDeliveryEvents.query — check for post-delivery ZAP removals or user interactions
  5. alertInfo.query — correlate hunted emails with existing alerts

Secure Score Monitoring

  1. secureScore.list — retrieve the latest score snapshots
  2. secureScoreControlProfile.list — enumerate controls and their current state
  3. Based on low-scoring controls, apply targeted policy fixes via the relevant EXO policy resources

Field Reference

Alert Severity Values

ValueDescription
unknownSeverity not yet determined
informationalInformational alert, no immediate action needed
lowLow-impact alert
mediumMedium-impact, requires attention
highHigh-impact, requires immediate investigation

Alert Status Values

ValueDescription
newAlert not yet reviewed
inProgressAlert is actively being investigated
resolvedAlert investigation completed

Alert Classification Values

ValueDescription
truePositiveConfirmed malicious activity
informationalExpectedActivityExpected or authorized activity
falsePositiveIncorrectly triggered alert

Threat Submission Status Values

ValueDescription
notStartedSubmission queued, not yet started
runningMicrosoft is actively analyzing the submission
succeededAnalysis completed
failedAnalysis failed
skippedSubmission skipped (duplicate or invalid)

Threat Submission Category Values

ValueDescription
notJunkLegitimate message or content incorrectly flagged
spamUnsolicited bulk mail
phishingCredential-harvesting or deceptive message
malwareMessage or file contains malware

Troubleshooting

IssueResolution
Azure AD token error [invalid_client]Verify that Client ID and Client Secret are correct and that the secret has not expired
Azure AD token error [unauthorized_client]Confirm the App Registration exists in the correct tenant and that application (not delegated) permissions are configured
Graph API error [Forbidden]Ensure the required Graph API permissions are configured and admin consent has been granted
Graph API error [BadRequest]: Resource not found for the segment 'threatSubmissions'Your tenant does not have a Defender for Office 365 Plan 2 license — threat submission resources require Plan 2
EXO API error [Unauthorized]Ensure Exchange.ManageAsApp is granted and the service principal is assigned the Exchange Administrator Azure AD role
EXO API error [BadRequest] on policy operationsIf trying a resource listed in microsoft-defender-office-365-not-integrated.md, that resource is not supported by this integration
EXO InvokeCommand error [cmdlet not recognized]The EXO cmdlet is not available on this tenant's Exchange Online version. The skip helper in E2E tests will catch this — it is not a code defect
Alert or incident list returns results from non-MDO365 sourcesAdd "serviceSource": "microsoftDefenderForOffice365" to your list parameters to scope results
OData filter syntax errorString values require single quotes (e.g., severity eq 'high'). Use raw $filter for complex expressions
Shortcut filter ignoredIf both a shortcut (e.g., severity) and a raw $filter are provided, the shortcut is ignored. Use one approach per query
Advanced Hunting returns no rowsVerify the table name is correct and the time range covers the period of interest. Check that ThreatHunting.Read.All is granted
EXO token: 401 Unauthorized on EXO resourcesToken acquisition may have failed for the EXO scope. Verify Exchange.ManageAsApp is configured on the Office 365 Exchange Online API (not on Microsoft Graph)
Priority Account operations failThe Priority Account feature requires Microsoft 365 E3, E5, or Business Premium
Audit log returns no resultsEnsure Unified Audit Log is enabled in the Microsoft 365 compliance center. Allow up to 30 minutes after enabling before events appear
Token expiry issuesThe integration caches tokens and refreshes them automatically. Recreate the credential if persistent auth errors occur

Best Practices

  1. Grant minimum required permissions: For read-only workflows, grant only *.Read.All variants and omit *.ReadWrite.All. This limits the blast radius if credentials are compromised.

  2. Rotate client secrets regularly: Azure App Registration client secrets expire. Set calendar reminders before the expiry date and update the NINA credential in advance to avoid workflow disruptions.

  3. Scope alert and incident queries to MDO365: The Graph Security API returns alerts from all Microsoft security services. Always use the serviceSource = "microsoftDefenderForOffice365" shortcut (or equivalent $filter) to scope results unless your workflow specifically needs cross-service data.

  4. Use Advanced Hunting for correlation: The Advanced Hunting tables (emailEvents, emailPostDeliveryEvents, etc.) are significantly more powerful than alert queries for investigating specific messages, senders, or URLs. Use them for hunting before escalating to alert management.

  5. Use shortcut filters for simple queries: The severity, status, state, and similar shortcut parameters are simpler to configure than raw OData and are combined automatically with and. Switch to raw $filter only when you need or logic, multiple conditions, or OData functions.

  6. Understand the policy/rule split for EXO resources: Safe Attachments, Safe Links, Anti-Phishing, and Anti-Spam all follow a two-object model — a policy defines settings and a rule defines the recipient scope. This integration exposes rules (which can be listed, filtered, enabled/disabled) and policies where available. Create policies first via the portal or PowerShell, then manage their rules through NINA.

  7. Do not delete the default policy: Exchange Online creates a default "Built-in Protection" policy for each protection type. Deleting or modifying default policies may leave mailboxes unprotected.

  8. Set appropriate Unified Audit Log date ranges: Audit log queries are bounded by the log retention period (90 days for E3, 1 year for E5). Querying wide date ranges with no filters can be slow — narrow with operations or userIds when possible.

  9. Protect client secrets: Store credentials exclusively through NINA's credential manager. Never include Client IDs or secrets in workflow parameters, logs, or comments.

  10. Use a dedicated App Registration: Register a dedicated Azure App for this integration rather than reusing credentials shared across other systems. This isolates the credential lifecycle and makes permission auditing easier.

Updated: 2026-06-10