Did you follow these steps? Including adding the Exch Role to the service principal?
https://practical365.com/use-azure-automation-exchange-online/
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Guys,
I am trying to create and also get distribution list using a powershell runbook (version 5.1) setup in an Azure Automation account. But am having trouble connecting to Exchange Online.
=========
My Script (1):-
Connect-ExchangeOnline -ManagedIdentity -Organization "contoso.onmicrosoft.com"
Get-DistributionGroup
ERROR MESSAGE:
This throws the Unauthorized error
========
I have registered an app in Azure and assigned necessary permissions.
(- Exchange.ManageAsApp, - Group.Read.WriteAll)
Please any help would be much appreciated. Thanks
Did you follow these steps? Including adding the Exch Role to the service principal?
https://practical365.com/use-azure-automation-exchange-online/