Did you assign a matching admin role to the service principal corresponding to your app? The "Exchange Recipient Management" role or equivalent role/role group in Exchange Online is required.
Unable to create Distribution lists using exchange online with app-only authentication(Azure AD Application) with exchange online
Requirement: To create Distribution lists using exchange online with app-only authentication.
Description:
- I am using Azure AD credentials to connect to exchange online, because i wanted to create distribution lists automatically without user involvement.
- After authentication, whenever I am using commands like New-DistributionGroup, Add-DistributionGroupMember,Remove-DistributionGroup ,Remove-DistributionGroupMember ,Update-DistributionGroupMember an error showing like below
New-DistributionGroup : "The term 'New-DistributionGroup' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again".
- New-DistributionGroup
-
- CategoryInfo : ObjectNotFound: (New-DistributionGroup:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
Exchange Online
2 answers
Sort by: Most helpful
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2024-05-27T16:53:09.3866667+00:00 -
Anonymous
2024-05-28T08:00:36.3133333+00:00 Thanks for posting your question in the Microsoft Q&A forum.
When you run New-DistributionGroup, a message appears that the command is not recognized.
If only administrator role are not enough, a query reveals that it also requires the "Recipient Management" or "Security Administrator" roles.
You can add users to role groups in EAC- Admin roles.
If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.