Unauthorized when using Add-DistributionGroupMember to add user to Exchange managed Distribution

Shawn Imholte 20 Reputation points
2024-10-17T17:37:22.63+00:00

I followed the steps in this article https://learn.microsoft.com/en-us/powershell/exchange/connect-exo-powershell-managed-identity?view=exchange-ps&WT.mc_id=M365-MVP-9501 to use my Azure Automation System managed identity to connect to ExchangeOnline but when I use the CmdLet Add-DistributionGroupMember I get an Unauthorized exception. I tried adding the -BypassSecurityGroupManagerCheck flag but it still comes back Unauthorized. I followed Step 5 in the article mentioned above so that Identity is already an ExchangeAdministrator. What other permissions does that user need?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,542 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,552 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,904 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce Jing-MSFT 5,255 Reputation points Microsoft Vendor
    2024-10-18T02:45:23.4566667+00:00

    Hi,@Shawn Imholte

    Thanks for posting your question in the Microsoft Q&A forum.

    Based on your description, you are using Azure to host Exchange Online. i am not sure if it is Azure that is affecting the use of Add-DistributionGroupMember. Can you describe specifically how you are using Add-DistributionGroupMember? It is recommended that you disconnect Azure Hosted Exchange Online first and only run commands in Exchange Online PowerShell.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.