After you’re done setting this up, you can set up an Azure Automation account, create an Azure runbook, and automate the process using the steps below.
The first step is to ensure you have an Azure subscription. Then create an Azure Automation account. To do this, follow the steps here: Create Automation account
In your Automation account, go to Shared Resources > Modules to ensure you have an AzureAD module in the list of available modules. If you don't see it available, click on Browse gallery , search for Azure AD and click Import .
You can find your created runbook under Process Automation in your Automation account. Click on your runbook. At the top of the page, go to Schedule > Create a new schedule.
Set up the schedule you want and link to your runbook. Make sure your Parameters and Run settings under Schedule are set to Run on Azure .
In your runbook, click Edit. Paste your PowerShell script in here and input Azure application details and webhook URIs. You can change Write-Host in the script to Write-Output if you want to see the results in the output window of the runbook.
Don’t forget to go back to your runbook and press Start . Your messages will now be delivered to the platforms you’ve chosen on the schedule you’ve configured in your runbook.