Add exception to DLP rule based on trigger word in email subject line - powershell or any other method

Joseph Saling 1 Reputation point
2022-05-20T20:51:02.757+00:00

I have setup DLP rules that apply email messages in Exchange online. It is currently in report only mode. It is working, identifying things like a SSN in an email message or an attachment.

We use a trigger word in email subject lines that will send a message automatically through secure email messaging - for example if SendSecured (case insensitive) is anywhere in the subject line and it doesn't have to be the only thing on the subject line, it will flow through the secure messaging system.

Today, these messages, even though sent correctly based on our policies, are being reported by DLP.

How do I add an exception to the DLP rule (or policy) so that it only triggers when ExceptIf SubjectContainsWords "SendSecured" is true?

all my searches lead me back to https://learn.microsoft.com/en-us/microsoft-365/compliance/dlp-conditions-and-exceptions?view=o365-worldwide where it appears this is the correct exception parameter to apply, but I've not been able to figure out how to do this in PowerShell. I can see that the field is blank, but I can't figure out how to add this.

Please help!

Exchange Exchange Server Management
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2022-05-21T06:20:27.94+00:00

    The cmdlet you need is Set-DlpComplianceRule, and in your case likely the -ExceptIfSubjectOrBodyMatchesPatterns parameter will do for the exception. To get the rule, use this:

    Get-DlpComplianceRule -Policy DLPPolicyName  
    

    All the cmdlets require you to connect to the SCC endpoint: https://learn.microsoft.com/en-us/powershell/exchange/connect-to-scc-powershell?view=exchange-ps

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.