A quick way to copy the conditions of a DLP rule with PowerShell and the AdvancedRule parameter
Sometimes the easiest way to build a complex Microsoft Purview Data Loss Prevention rule is not to start from scratch. You may already have a rule whose conditions, classifiers, and nested logic are exactly what you need for a lab, a backup, or a similar deployment in another tenant.
This is where the AdvancedRule property can be very useful.
In this post, I will show you how I extract the condition logic from an existing DLP rule, remove a few properties that can cause portability problems, save the result as JSON, and use it with New-DlpComplianceRule.






