Create shared mailboxes and distribution lists via Microsoft Graph API

876 views Asked by At

I have to create shared mailboxes and distribution lists (+ maintain their memberships) in an Exchange Online environment. If I understood correctly, there is no particular REST API available at this point.

The only way to achieve this right now is to create the mailboxes as regular users and distribution lists as distribution groups (via Graph API). Is this the preferred way to go? How do I define that this mailbox "user" is an actual shared mailbox having members? How would I assign users to these mailboxes?

Thanks for your help!

1

There are 1 answers

0
Satya V On

If you are looking a programmatical approach of creating SharedMailbox you could utilize the below powershell commmandlet

New-Mailbox -Shared -Name "<NAME>" -DisplayName "<Name>" -Alias <ALIAS> | Set-Mailbox -GrantSendOnBehalfTo <SECURITYGROUPALIAS> | Add-MailboxPermission -User <SECURITYGROUPALIAS> -AccessRights FullAccess -InheritanceType All

The shared mailbox that will be created and security group will be granted with the necessary permissions.

In the above example - add the necessary members to security group.