How it works...

DLP works through DLP Policies, packages that contain a set of conditions made up of rules, actions, and exceptions. These packages are based on Transport Rules and can be created in the Exchange Administration Center or through the Exchange Management Shell. Once created and activated, they will start analyzing and filtering emails.

To create our DLP policy, we used the New-DlpPolicy cmdlet and gave our policy the name of "Block Outbound Credit Card Details". Using the -Template parameter, we specified that this policy should use the Microsoft-provided template U.K. Financial Data. To know more about this template, or any other template provided by Microsoft, we can use the Get-DlpPolicyTemplate cmdlet:

Alternatively, you ...

Get Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.