Skip to main content
BRITECITY
SUPPORT
INDUSTRIESPRICING
(949) 243-7440Book a Call
BRITECITY
4 Executive Circle Suite 190
Irvine, CA 92614
(949) 243-7440

Company

  • About
  • Contact
  • Support
  • Knowledge Base
  • Case Studies
  • Resources
  • Articles
  • Pricing
  • Referral Program

Solutions

  • Managed IT Services
  • Cybersecurity
  • Cloud Services
  • Help Desk Support
  • Network Security
  • Business Continuity

Industries

  • Professional Services
  • Construction & Real Estate
  • Legal
  • Healthcare
  • Manufacturing
  • Financial Services
  • Nonprofits

Locations

  • Irvine
  • Newport Beach
  • Costa Mesa
  • Tustin
  • Santa Ana
  • Laguna Beach
  • Mission Viejo
  • Lake Forest

© 2026 BRITECITY, LLC

|
Privacy Statement|Terms & Conditions|Disclaimer|Imprint
  1. Home
  2. Resources
  3. M365 Email Scanning Guide
✦
Back to Resources
Guide10 min readUpdated February 2026

How to Scan Microsoft 365 Mailboxes for Malicious Email (2026 Guide)

By BRITECITY | 17+ years experience

Published February 13, 2026

Expertise: Microsoft 365 Security, Email Threat Response, Cybersecurity

Complete guide to scanning Microsoft 365 mailboxes for malicious email. Covers Defender Threat Explorer, Content Search, eDiscovery, PowerShell commands, and MSP multi-tenant workflows.

To scan Microsoft 365 mailboxes for malicious email, use Threat Explorer in Microsoft Defender for Office 365 Plan 2 to search by sender, subject, URL, or attachment hash and remediate directly. If you do not have Defender P2, use Content Search in the Purview Compliance Portal with PowerShell purge commands. Both methods let you scope the blast radius and remove threats across all affected mailboxes.

When a phishing email lands in your organization, every minute counts. The faster you identify affected mailboxes and remove the threat, the lower your risk of credential theft, data exfiltration, or ransomware deployment. This guide covers every method available in Microsoft 365 for scanning, finding, and removing malicious email, from built-in Defender tools to PowerShell automation and MSP-scale multi-tenant workflows.

Microsoft-Native Tools for Email Threat Scanning

Microsoft 365 includes several built-in tools for scanning mailboxes. The right tool depends on your licensing level and the scale of the investigation.

Microsoft Defender for Office 365 (Plan 2)

Defender for Office 365 Plan 2 is the most powerful native tool for email threat investigation and remediation. It is included in Microsoft 365 E5, or available as an add-on for E3 and Business Premium plans.

Threat Explorer / Real-Time Detections

Threat Explorer lets you search across all mailboxes by sender address, subject line, URL, attachment hash, delivery action, and date range. Once you identify the malicious messages, you can remediate directly from the same interface. Options include soft delete, hard delete, and move to junk. Real-Time Detections provides the same search capabilities on a narrower time window for Plan 1 customers.

Automated Investigation and Response (AIR)

AIR triggers automatically when certain alerts fire, or you can launch it manually from Threat Explorer. It investigates the threat, identifies all affected users, and recommends or executes remediation actions. For organizations that receive high volumes of phishing, AIR dramatically reduces the manual burden on security teams.

Threat Trackers

Threat Trackers are saved queries that let you monitor for specific indicators of compromise (IOCs) on an ongoing basis. If you are tracking a campaign that targets your industry, you can create a tracker for the sender domain or subject pattern and get notified when new matches arrive.

Content Search and eDiscovery

If your organization does not have Defender for Office 365 Plan 2, Content Search in the Microsoft Purview Compliance Portal is your primary tool. It is included in most Microsoft 365 plans, including Business Basic, Business Standard, E1, and E3.

Content Search Workflow

  1. 1Open the Purview Compliance Portal and navigate to Content Search.
  2. 2Create a new search filtered by sender address, subject line, keywords, or date range.
  3. 3Review results to scope the blast radius across your organization.
  4. 4Purge messages using New-ComplianceSearchAction -Purge via PowerShell (see below).

Content Search supports KQL (Keyword Query Language) for complex queries. You can search across mailboxes, SharePoint, OneDrive, and Teams. For email-specific investigations, filter by kind:email and use properties like from:, subject:, and received:.

PowerShell Approaches for Email Scanning

PowerShell gives you granular control over mailbox searches and is essential for automating repetitive threat hunting tasks. Here are the key commands every M365 administrator should know.

Search and Copy to Discovery Mailbox
Get-Mailbox -ResultSize Unlimited | Search-Mailbox \
  -SearchQuery "from:malicious@domain.com" \
  -TargetMailbox "DiscoveryMailbox" \
  -TargetFolder "Investigation"

Searches all mailboxes for messages from a specific sender and copies them to a discovery mailbox for review. Replace the sender address with your IOC.

Message Trace (Last 10 Days)
Get-MessageTrace \
  -SenderAddress "malicious@domain.com" \
  -StartDate (Get-Date).AddDays(-10) \
  -EndDate (Get-Date)

Traces message delivery over the last 10 days. Shows recipient, status, date, and subject. Useful for quickly scoping how many users received a specific message.

Compliance Search Purge
# Create the compliance search
New-ComplianceSearch -Name "PhishRemoval" \
  -ExchangeLocation All \
  -ContentMatchQuery 'from:malicious@domain.com AND subject:"Invoice"'

# Start the search
Start-ComplianceSearch -Identity "PhishRemoval"

# After search completes, purge (soft delete)
New-ComplianceSearchAction -SearchName "PhishRemoval" \
  -Purge -PurgeType SoftDelete

Creates a compliance search, runs it, then purges matching messages. Use SoftDelete to move to Recoverable Items, or HardDelete for permanent removal.

Important: The Search-Mailbox cmdlet is being deprecated. Microsoft recommends using Content Search with New-ComplianceSearchAction -Purge for new workflows. However, Search-Mailbox remains useful for quick ad-hoc investigations where you need to copy messages to a discovery mailbox.

The 5-Step Incident Response Workflow

When you discover a malicious email has reached your users, follow this structured workflow to contain the threat quickly and thoroughly.

1

Identify the Indicator of Compromise (IOC)

Collect the sender address, subject line, URLs in the message body, and attachment names or file hashes. The more IOCs you have, the more precise your search will be. Check the email headers for the true sending IP and domain.

2

Search to Scope the Blast Radius

Use Threat Explorer or Content Search to find every instance of the malicious message across all mailboxes. Determine how many users received it, how many opened it, and whether anyone clicked links or downloaded attachments.

3

Remediate Across All Affected Mailboxes

Purge or soft-delete the malicious messages from every mailbox where they were delivered. In Threat Explorer, select all results and choose your remediation action. With Content Search, use the PowerShell purge command.

4

Block the Threat at the Tenant Level

Add the sender address, domain, or URL to your Tenant Allow/Block List in the Microsoft 365 Defender portal. This prevents the same IOC from reaching users again. For URLs, also add them to your Safe Links block list.

5

Investigate User Interaction

Check whether anyone clicked links (URL trace in Threat Explorer) or opened attachments. If users interacted with the threat, initiate password resets, check for mail forwarding rules, and review sign-in logs for suspicious activity.

Choosing the Right Tool for Your License

Not every Microsoft 365 plan includes the same scanning tools. Here is a quick reference for matching your license to the best available method.

ToolRequired LicenseBest For
Threat ExplorerDefender for Office 365 P2 / M365 E5Full investigation and remediation with click tracking
Real-Time DetectionsDefender for Office 365 P1Quick threat visibility with limited remediation
Content SearchMost M365 plans (E1, E3, Business)Searching and purging when Defender P2 is not available
Message TraceAll Exchange Online plansQuick delivery status check (last 10 days)
AIRDefender for Office 365 P2 / M365 E5Automated investigation for high-volume environments

MSP and Multi-Tenant Considerations

For managed service providers (MSPs) managing multiple Microsoft 365 tenants, the single-tenant tools above need to be scaled across every client environment. There are several approaches to achieve cross-tenant visibility.

Microsoft Lighthouse

Microsoft 365 Lighthouse provides a multi-tenant management portal for MSPs with GDAP access. It aggregates security alerts and incidents across all client tenants into a single view. While it does not replace Threat Explorer for deep investigation, it helps you identify which tenants are affected by a campaign quickly.

Third-Party Security Platforms

Tools like Hornet Security, Avanan (Check Point), and SaaS Alerts provide cross-tenant email security monitoring from a single dashboard. These platforms can detect threats that bypass Microsoft's native filters and provide unified reporting across your entire client base.

Microsoft Graph API Automation

For MSPs that want full control, the Microsoft Graph API provides programmatic access to email data across tenants. The /security/alerts and /messages endpoints let you build automated IOC sweep workflows that search every client tenant for a specific threat indicator and report results in minutes rather than hours.

Building an Automated Cross-Tenant Sweep

The most mature MSP security operations automate the IOC sweep process entirely. When a new threat indicator is identified, an automated workflow can search every managed tenant simultaneously and generate a consolidated report. Here is the typical architecture:

Automated IOC Sweep Architecture

  • Receive IOC alert from threat intelligence feed or manual submission
  • Authenticate to each client tenant using GDAP or app-only credentials
  • Query Microsoft Graph /messages endpoint filtered by sender, subject, or URL
  • Query /security/alerts for related Defender alerts
  • Aggregate results into a single dashboard or ticketing system
  • Auto-create remediation tickets for affected tenants
  • Execute purge actions via Graph API or PowerShell runbooks
  • Generate post-incident report documenting scope and remediation

Common Mistakes to Avoid

Even experienced administrators make mistakes during email threat investigations. Here are the most common pitfalls and how to avoid them.

Searching Only the Reporter's Mailbox

When a user reports a phishing email, always search the entire organization. The same message was likely delivered to dozens or hundreds of mailboxes.

Forgetting to Block After Purging

Deleting the message is not enough. If you do not add the sender or URL to your block list, follow-up messages from the same campaign will land in inboxes again.

Ignoring Click and Open Data

Removing the email is step one. If users already clicked a link or opened an attachment, you need to investigate further, including password resets and session revocation.

Using Only Subject Line Searches

Attackers vary subject lines across campaigns. Search by sender address, sending domain, URL patterns, and attachment hashes in addition to subject lines.

How BRITECITY Protects Your Microsoft 365 Environment

As a Microsoft Solutions Partner for cybersecurity, BRITECITY provides proactive email threat monitoring and rapid incident response for Microsoft 365 environments. Our security operations team monitors for threats around the clock and can execute the full investigation-to-remediation workflow in minutes, not hours.

What BRITECITY Delivers

  • Continuous email threat monitoring across your Microsoft 365 tenant
  • Rapid IOC investigation using Defender Threat Explorer and PowerShell
  • Automated remediation workflows that purge threats across all mailboxes
  • Tenant Allow/Block List management to prevent repeat attacks
  • Post-incident reporting with click tracking and user interaction analysis
  • Security awareness training to reduce phishing susceptibility
  • Ongoing Threat Tracker monitoring for industry-specific campaigns

Whether you manage your own Microsoft 365 environment or need a partner to handle email security for you, the tools and workflows in this guide give you the foundation for effective email threat response. For organizations that want expert support, BRITECITY's managed IT services include comprehensive email security as part of every plan.

Call us at 949-243-7440 or book a free consultation to discuss your Microsoft 365 security posture.

About the Author

BRITECITY

Written by the BRITECITY with over 17 years of combined IT experience. Our experts hold certifications including Microsoft Solutions Partner, CompTIA Security+.

Microsoft 365 SecurityEmail Threat ResponseCybersecurityManaged IT Services

Answers

Key Questions Answered

How do I search all Microsoft 365 mailboxes for a malicious email?

Use Threat Explorer in Microsoft Defender for Office 365 Plan 2 to search by sender, subject, URL, or attachment hash across all mailboxes. If you do not have Defender P2, use Content Search in the Purview Compliance Portal. Both tools let you scope affected mailboxes and remediate directly.

Can I delete a phishing email from all mailboxes at once in Microsoft 365?

Yes. In Threat Explorer, select the messages and choose soft delete, hard delete, or move to junk. With Content Search, run the search and then execute New-ComplianceSearchAction -Purge via PowerShell. Both methods remove the message from all affected mailboxes simultaneously.

What PowerShell commands scan for malicious email in Exchange Online?

Use Get-MessageTrace to check delivery status for a sender over the last 10 days. Use Search-Mailbox to copy matching messages to a discovery mailbox. For bulk purging, use New-ComplianceSearch with New-ComplianceSearchAction -Purge to remove messages across all mailboxes.

What is the difference between Threat Explorer and Content Search?

Threat Explorer is part of Defender for Office 365 Plan 2 and provides rich investigation features including click tracking, URL analysis, and direct remediation. Content Search is available in most M365 plans and supports searching and purging email but lacks the advanced threat intelligence features.

How do MSPs scan for malicious email across multiple Microsoft 365 tenants?

MSPs use Microsoft Lighthouse for cross-tenant alert visibility, third-party platforms like Hornet Security or Avanan for unified monitoring, and the Microsoft Graph API to automate IOC sweeps across all client tenants programmatically.

What should I do after removing a malicious email from Microsoft 365?

After purging the email, add the sender, domain, or URL to the Tenant Allow/Block List. Then investigate whether any users clicked links or opened attachments. If interaction occurred, reset passwords, revoke sessions, and check for mail forwarding rules.

Do I need Defender for Office 365 to remove phishing emails?

No. Content Search in the Purview Compliance Portal is available in most M365 plans and supports searching and purging email via PowerShell. However, Defender for Office 365 Plan 2 provides significantly better investigation tools, automated response, and click tracking.

Next Step

Ready to Discuss Your IT Needs?

Get personalized advice based on your specific situation. No pressure, just honest guidance.

Book a Free ConsultationCall (949) 243-7440