How to export a existing DLP Policy schema and create a policy based on this schema using Power shell?

Koteswararao Kata 1 Reputation point
2021-03-15T17:56:23.187+00:00

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?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,178 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    2021-03-15T18:58:38.097+00:00

    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


  2. Lucas Liu-MSFT 6,191 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.


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.