- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-06-2022 07:47 PM
Hi all,
I am trying to find some information/documentation on how to add user to a shared mailbox using IntegrationHub with Microsoft Exchange Online spoke - Looking at the spokes documentation, it seems that there is no ootb action such as "Add user to mailbox" to give full access or send as kind of access.
I have found the information on how to do this via Orchestration activities where you add scripts to run Exchange online powershell commands - however, using the Exchange online spoke directly connected to the Exchange online > I was hoping to see an action that could be used to just "Add user to mailbox" with appropriate permissions.
If anyone has used the spoke for doing such things - Any information or documentation on this would be helpful.
Thanks.
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2022 03:18 PM - edited ‎12-02-2022 03:23 PM
Hi @Kevin Moore @Jennifer Doll @RobertR1 ,
Sorry i have not been looking at the emails recently thats why could not reply. Here is what you need to setup the add user to mailbox:
- You need EXO PS module installed on your mid server:
https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps
https://www.powershellgallery.com/packages/ExchangeOnlineManagement/3.0.0
- The OAuth 2.0 EOL connection is fine, you also need a credential to run PS scripts on your EOL environment - hence on the doco there is a step for Windows credential - however, i would suggest not to use basic outh username password method - Instead you need this credentials setup through a certificate - This below will help - This certificate thumbprint needs to be than added to the mid server so we can use it on the connect EXO cmd on mid server script file:
https://learn.microsoft.com/en-us/powershell/module/exchange/connect-exchangeonline?view=exchange-ps
https://office365itpros.com/2020/08/13/exchange-online-cba/
- Mid server script file attached - please add your certificate thumbprint, clientid, org domain - make sure your org domain is @mydomain.onmicrosoft.com.
- on the mid server script actual Add-MailboxPermission command - I have two cmd line - one for adding user to full access and second for adding user to send as access - update as per your requirement:
$mailboxname This is the variable you need to pass the mailbox email address
$user This is the variable you need to pass your user email address
Next the Flow custom action as below:
I only needed two input for this - add/update as you required, you can see the two variable above that i mentioned is in here and the name matches to the PS cmd in the mid server script file:
To your question @Mark that you could not change the mid server script is because you were trying to change on the OOTB action - it does not allow on OOTB (I am guessing you have already figured this out but fyi) Below is where you add the mid server file that i have attached here.
On this same page further down make sure you map those input variables:
The next error handling part i am just using the ootb by changing the variables to mine.
I hope this will get your setup running.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2022 11:44 AM
Hi Sam,
First off, thank you very much!!! Good information. It makes sense to use a certificate for authentication.
One question, for your connection record using Windows credentials, did you leave that blank or does it need to be able to authenticate to the MID server with a service account?
I understand that the script is actually doing the authentication to Exchange Online but still wondering about the connection record. It still seems to be required. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2022 08:51 PM
Hi Kevin,
This credential is used to run EOL powershell module on your mid server, so whatever credential you have that gives permissions on mid server is what goes here. For me I am using the mid server user account that has admin access to the mid server windows box to run anything.
Regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2023 10:58 PM
Hello @Sam198 ,
Is there any way to achieve this without using MID server? I have a requirement to grant mailbox permission for employee termination as manager need to check terminated user's mail history.
Thanks,
Pooja
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 11:24 AM
Hi Pooja, not that I'm aware of. You'll need a MID server with the Exchange Online PowerShell module installed. Once that's setup you're need a PowerShell script to run a command such as -
Add-MailboxPermission -identity $termUser -User $manager -AccessRights FullAccess -AutoMapping:$false
The PowerShell script will also need to use Certificate based Authentication to establish a connection with Exchange online. Here's a good video that walks through the certificate auth setup.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2023 11:26 AM
Hi Pooja, not that I'm aware of. You'll need a MID server with the Exchange Online PowerShell module installed. Once that's setup you're need a PowerShell script to run a command such as -
Add-MailboxPermission -identity $termUser -User $manager -AccessRights FullAccess -AutoMapping:$false
The PowerShell script will also need to use Certificate based Authentication to establish a connection with Exchange online. Here's a good video that walks through the certificate auth setup-