Can I use PS Script/Logic App/Power Automate to add email addresses to mail flow rules?


In Exchange admin center, we have two rules - Inbound and Outbound - for scam addresses that we add email addresses to so they're blocked from sending to internal users and preventing internal users from sending emails to.


Right now it's a manual process for us and I was wondering if there was a way to automate this via PS Script/Logic App/Power Automate?



3 Replies
best response confirmed by Jeff Walzer (Contributor)

@Jeff Walzer , 

Hi There, 


If you have Azure subscription, you can create Azure Automation Account and run your PS against Exchange Online. Than you can use Flow (Power Automation) to trigger your script to run based on any conditions Flow excepts. 



You can certainly use PowerShell to adjust the rules, but you will inevitably hit the limits. Better work with the users, have them make a habit of reporting such messages via the Report message add-in.

@Vasil Michev I have to agree. We published the add-in 'Report Message' from the portal to the entire organization a year ago and the decrease in such tickets to our support unit has been huge. It's really user-friendly as well.