Forum Discussion
AB21805
Apr 19, 2024Bronze Contributor
Error Running Script in Runbook with System Assigned Managed Identity
Hello everyone, I could use some assistance, please. I'm encountering an error when trying to run a script within a runbook. I'm using PowerShell 5.1 with a system-assigned managed identity. The sc...
Kidd_Ip
Jun 23, 2025MVP
Instead of Send-MailMessage, consider using Microsoft Graph to send mail. You can authenticate with your managed identity and send emails via Graph, which is fully supported in Azure Automation:
- Assign the managed identity the Mail.Send permission in Microsoft Graph.
- Use Invoke-RestMethod or the Microsoft Graph PowerShell SDK to send the email.