How to Bulk Import Domain Exceptions for Microsoft 365 Filtering
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.

- 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.
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.
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.
Open PowerShell as an administrator and connect to your Microsoft 365 tenant using the Connect-ExchangeOnline cmdlet.
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')).
Run the New-TenantAllowBlockListItems cmdlet, specifying the domains and the appropriate ListType (e.g., Domain) to apply the exception rules in bulk.

Configure Exceptions in DLP Policies
DLP policies handle exceptions differently than spam filters and may require specific compliance cmdlets or UI modifications.
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.

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.




