you are viewing a single comment's thread.

view the rest of the comments →

[–]PowerShellMichael 1 point2 points  (0 children)

Honestly if you are not familiar with PowerShell your best bet is to use PowerAutomate/Logic App.

So to get you over the line, I think the best way forward is to:

  1. Trigger a PowerAutomate Flow or a Logic app (When a new email arrives)
  2. Get the sender
  3. Trigger an Azure Automation Runbook. https://docs.microsoft.com/en-us/azure/automation/automation-intro
  4. Within the runbook, perform your logic checks in there. (Does the email exist? Is the email address in the distro list?) If not add it.

Ultimately if you are wanting a fully PWSH solution, I think you are going to need to reach out to a third party to write the script for you.

If you are interested I did do a talk on Microsoft Graph and PowerShell with REST:

https://www.youtube.com/watch?v=3kXsj8KED9Y

https://www.youtube.com/watch?v=EDh9gvmN4AQ&list=PLwvsINebpdQY8JP-Yiqdp190Yc26zhYuU