How to Add Bulk Domain Exceptions to Microsoft DLP Policies
Question details
The user needs to configure Microsoft Data Loss Prevention (DLP) policies to exclude multiple recipient domains simultaneously.

- Product
- Microsoft Purview / Microsoft 365 DLP
- Device & OS
- not provided
- Scenario
- Managing and updating Data Loss Prevention compliance rules in a Microsoft 365 environment.
- Observed behavior
- The user is looking for a method to bulk add domains to the 'ExceptIfRecipientDomainIs' parameter in DLP compliance rules.
Ensure you have the necessary administrative privileges (such as the Compliance Administrator role) to access and run cmdlets in the Security and Compliance PowerShell module.
Use Security and Compliance PowerShell to Add Bulk Domains
Leverage PowerShell cmdlets to efficiently update DLP compliance rules with multiple domain exceptions without using the graphical interface.
Using the Microsoft Purview compliance portal to add dozens of domain exceptions manually can be tedious. Security and Compliance PowerShell allows you to apply bulk domain lists directly to the target DLP rule using a single script or command.
Open your PowerShell terminal as an administrator and connect to the Security and Compliance PowerShell module using your admin credentials.
Run the `Get-DlpComplianceRule` cmdlet to find the exact identity string or name of the DLP rule you want to modify.
Use the `Set-DlpComplianceRule` cmdlet alongside the `-ExceptIfRecipientDomainIs` parameter. Pass your domains as a comma-separated list. For example: `Set-DlpComplianceRule -Identity "YourRuleName" -ExceptIfRecipientDomainIs "example.com", "contoso.com"`.
Run the `Get-DlpComplianceRule` cmdlet again targeting the modified rule to confirm that all specified recipient domains have been successfully added to the exception list.

Manage Your Office Documents Securely with WPS Office
While managing complex IT policies requires specialized administrative tools like Microsoft Purview and PowerShell, day-to-day document creation and collaboration shouldn't be a hassle. WPS Office offers a free, highly compatible, and lightweight alternative for your team's word processing, spreadsheet, and presentation needs.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer designed for your operating system.
- 2. Install the Software: Run the downloaded executable file and follow the on-screen prompts to quickly set up the office suite.
- 3. Open Your Files Securely: Launch WPS Office and seamlessly open your existing Microsoft documents. Utilize the built-in encryption tools to protect your sensitive local data.

Frequently Asked Questions
Can I add bulk domain exceptions using the Microsoft Purview compliance portal UI?
While you can manually add domain exceptions through the Microsoft Purview compliance portal by editing the DLP policy rule conditions, the UI requires you to enter them one by one. Using Security and Compliance PowerShell is the recommended method for bulk additions.
Is there a limit to the number of domains I can add to a DLP exception?
Yes, Microsoft enforces size limits on the overall character count of a DLP policy rule. If you have hundreds of domains, you may reach this limit and will need to consolidate rules or use dictionary-based conditions if applicable.
Why aren't my DLP rule exceptions taking effect immediately?
Changes to DLP policies often take some time to propagate across the Microsoft 365 environment. While it typically takes about an hour, it can sometimes take up to 24 hours to fully sync across all services like Exchange, SharePoint, and Teams.




