- 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
‎07-14-2025 06:52 AM
Yes, it's possible. You can send API calls from ServiceNow to an Azure Runbook, which in turn executes scripts to add or remove access.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sam,
I'm curious if you have ever seen a "better" way to do this... since that module uses REST based calls... has anyone ever converted this into it's own spoke or used REST calls in place of the PS commands?
I quoted better...not cuz PS isn't a good way to go ... it just adds so many layers to the process for failure and it seems odd to me that we can't do what those cmdlets are doing via REST calls...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 01:36 AM
This topics is already more than 1.5 years ago.
As this is a topic that more and more customer are getting faced I'll opened an idea for importing e.g. Shared Mailboxes into CMDB-
Idea - Importing of Microsoft Exchange Online Mailboxes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2025 10:34 PM
Hi All ,
I tried using this information by using OOB spokes , but still i am facing error issues.
Error : PowerShell Execution Error
Requirement :
2 variables : requestedfor_email and mailbox emailaddress. Once user submits the catalog item request .user should should have full access automatically.
can someone help me please. I really need this to setup for my project.
Regards&Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2025 12:16 PM
pranavi, I would abandon the Exchange spoke and just use a flow to run the Exchange PowerShell scripts on the MID server instead. I was using the spoke but it was a pain for 2 reasons. 1) it's limited in what it can do. Using PowerShell, you are only limited by what is possible in PowerShell. 2) When the graph secrets expire, you need to set them up again in all of your environments.
Using certificates to authenticate and run your PowerShell scrips, you can simply copy the cert file to all of your MID servers.
If you want to go that route let me know and we can go down that road.
Here's a good video on how the auth certs work - https://www.youtube.com/watch?v=GyF8HV_35GA