Your best bet is the Export-DlpPolicyCollection cmdlet: https://learn.microsoft.com/en-us/powershell/module/exchange/export-dlppolicycollection?view=exchange-ps
You can also take a look at M365 DSC, which includes DLP policies configuration: https://github.com/microsoft/Microsoft365DSC
How to export a existing DLP Policy schema and create a policy based on this schema using Power shell?
Hi Team, We want to export a existing custom dlp policy schema and need to create a dlp policy based on the schema using powershell. Any suggestions or ideas over the possibilities?
2 answers
Sort by: Most helpful
-
Vasil Michev 94,521 Reputation points MVP
2021-03-15T18:58:38.097+00:00 -
Lucas Liu-MSFT 6,161 Reputation points
2021-03-16T06:17:54.737+00:00 Hi @Koteswararao Kata ,
Please try to create a new DLP policy in Exchange admin center and try to run the above command again. Then check to see if the correct XML file is exported.At present, I have not found a command line to update all DLP policies that apply the same custom template at the same time. I will continue to search and research, and I will update if there are any findings.
----------
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.