SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-1380436%22%20slang%3D%22en-US%22%3ECan%20I%20use%20PS%20Script%2FLogic%20App%2FPower%20Automate%20to%20add%20email%20addresses%20to%20mail%20flow%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1380436%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20Exchange%20admin%20center%2C%20we%20have%20two%20rules%20-%20Inbound%20and%20Outbound%20-%20for%20scam%20addresses%20that%20we%20add%26nbsp%3Bemail%20addresses%20to%20so%20they're%20blocked%20from%20sending%20to%20internal%20users%20and%20preventing%20internal%20users%20from%20sending%20emails%20to.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERight%20now%20it's%20a%20manual%20process%20for%20us%20and%20I%20was%20wondering%20if%20there%20was%20a%20way%20to%20automate%20this%20via%26nbsp%3BPS%20Script%2FLogic%20App%2FPower%20Automate%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThx%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1380436%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1381391%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20use%20PS%20Script%2FLogic%20App%2FPower%20Automate%20to%20add%20email%20addresses%20to%20mail%20flow%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1381391%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F173036%22%20target%3D%22_blank%22%3E%40Jeff%20Walzer%3C%2FA%3E%26nbsp%3B%2C%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20There%2C%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20Azure%20subscription%2C%20you%20can%20create%20Azure%20Automation%20Account%20and%20run%20your%20PS%20against%20Exchange%20Online.%20Than%20you%20can%20use%20Flow%20(Power%20Automation)%20to%20trigger%20your%20script%20to%20run%20based%20on%20any%20conditions%20Flow%20excepts.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESerdar%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1381710%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20use%20PS%20Script%2FLogic%20App%2FPower%20Automate%20to%20add%20email%20addresses%20to%20mail%20flow%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1381710%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20certainly%20use%20PowerShell%20to%20adjust%20the%20rules%2C%20but%20you%20will%20inevitably%20hit%20the%20limits.%20Better%20work%20with%20the%20users%2C%20have%20them%20make%20a%20habit%20of%20reporting%20such%20messages%20via%20the%20Report%20message%20add-in.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1381770%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20use%20PS%20Script%2FLogic%20App%2FPower%20Automate%20to%20add%20email%20addresses%20to%20mail%20flow%20rules%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1381770%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3BI%20have%20to%20agree.%20We%20published%20the%20add-in%20'Report%20Message'%20from%20the%20portal%20to%20the%20entire%20organization%20a%20year%20ago%20and%20the%20decrease%20in%20such%20tickets%20to%20our%20support%20unit%20has%20been%20huge.%20It's%20really%20user-friendly%20as%20well.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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?

 

Thx

3 Replies
Highlighted
Best Response confirmed by Jeff Walzer (Contributor)
Solution

@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. 

 

Serdar,

Highlighted

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.

Highlighted

@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.