Data Protection Issues

How to Bulk Import Domain Exceptions for Microsoft 365 Filtering

Khadija KhanKhadija Khan Nov 2, 2026 868 views

Question details

An administrator needs to bulk upload a list of domain exceptions for Microsoft 365 filtering policies instead of manually entering them one by one.

How to Bulk Import Domain Exceptions for Microsoft 365 Filtering
Product
Microsoft 365
Device & OS
not provided
Scenario
Tuning Data Loss Prevention (DLP) policies or configuring the Tenant Allow/Block List in Microsoft 365 for mail routing.
Observed behavior
Administrators require a streamlined administrative method to apply multiple domain exceptions simultaneously to manage security rules effectively.
Before you start

Verify whether your domain exception list is intended for Data Loss Prevention (DLP) rules or for Exchange Online mail spam filtering (Tenant Allow/Block List), as the administration methods differ significantly.

Solution 1Recommended

Use PowerShell for Mail Filtering Domain Exceptions

The most efficient way to add bulk domains to the Microsoft 365 Tenant Allow/Block List is via Exchange Online PowerShell.

If you are tuning spam filtering and email delivery, the Tenant Allow/Block List controls these domains. PowerShell allows you to loop through a CSV file and import these settings without using the Microsoft 365 Defender portal for each entry.

1
Connect to Exchange Online

Open PowerShell as an administrator and connect to your Microsoft 365 tenant using the Connect-ExchangeOnline cmdlet.

2
Prepare the domain list

Create a CSV file containing the domains you wish to exempt, or define them in a PowerShell array variable (e.g., $Domains = @('example.com', 'contoso.com')).

3
Execute the bulk import cmdlet

Run the New-TenantAllowBlockListItems cmdlet, specifying the domains and the appropriate ListType (e.g., Domain) to apply the exception rules in bulk.

Use PowerShell for Mail Filtering Domain Exceptions
Module Requirement: Ensure you have the latest Exchange Online Management (EXO V3) module installed to use the New-TenantAllowBlockListItems cmdlet.
Free Microsoft Office alternative

Try WPS Office as a Lightweight Alternative

While administering Microsoft 365 requires robust backend IT tools, your everyday office productivity does not have to be complicated or expensive. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office for creating, editing, and managing your documents.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx)Lightweight installation with blazing fast startup speeds for everyday administrative tasksFamiliar tabbed user interface, ensuring zero learning curve for seamless migrationBuilt-in PDF reader and editor for easy management of compliance reports and IT documentation
microsoft office alternative - wps office

Frequently Asked Questions

Can I upload a CSV file directly in the Microsoft 365 Admin Center for DLP exceptions?

Currently, the Microsoft Purview compliance portal does not offer a direct CSV upload button for adding domain exceptions within a specific DLP rule's graphical interface. Bulk updates usually require using PowerShell cmdlets tailored to Security & Compliance.

What is the Tenant Allow/Block List in Microsoft 365?

It is a security feature in Microsoft Defender for Office 365 that allows administrators to manually override spam filter verdicts by specifying domains, email addresses, or URLs that should always be blocked or allowed.

Which PowerShell module is required to bulk import allowed domains for mail filtering?

You need the Exchange Online PowerShell module to use cmdlets like New-TenantAllowBlockListItems for managing the Tenant Allow/Block List.