Forum Discussion

miaeb's avatar
miaeb
Copper Contributor
Dec 26, 2024

Microsoft Purview (DLP Policy via PowerShell)

 

Hello, 
I created a DLP policy within Microsoft Purview centered around Microsoft teams to block external users outside of my organization from sending/receiving sensitive data over teams, but the condition was set to block everyone per my PowerShell script. Any suggestions would be helpful. I want the condition/action to block those individuals outside of my organization not everyone. Which script would be appropriate to block only people outside of my organization. I tried several forums, but I still can't get the script to switch from everyone to block only people ouside of my organization. 

 

 

1 Reply

  • LainRobertson's avatar
    LainRobertson
    Silver Contributor

    Hi miaeb ,

     

    Your command looks fine.

     

    Have you checked the priority of your compliance rule? It's possible that your "SensitiveInfoRule" is fine (but check it with Get-DlpComplianceRule just to be sure), but a different rule with a higher priority is winning.

     

    By default, if you create a new rule and do not specify a value for "priority", it will be created as the lowest priority rule.

     

    Cheers,

    Lain

Resources