Information on how to add users to Exchange online shared mailbox using IntegrationHub Exchange online spoke?

Sam198
Mega Guru

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.

ServiceNow Store

find_real_file.png

1 ACCEPTED SOLUTION

Sam198
Mega Guru

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:

 

Sam198_4-1670023093095.png

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.

Sam198_5-1670023093109.png

 

On this same page further down make sure you map those input variables:

Sam198_6-1670023093111.png

 

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.

 

View solution in original post

24 REPLIES 24

Hi @J Siva , we just put the service account in the local admins group on each of the mid servers. 

Thanks Kevin. It worked.

Now I'm working on the Exchange Online integration. I've a query now. What should be the connection based url for exchange online?

In the prod doc it's mentioned to use 127.0.0.1.

Could you please help me here?

Thanks,

Siva

Yes, we are using the local host (127.0.0.1) for our connection alias (Connections & Credentials > Connections & Credentials Aliases),  if that's what you are referring to. We also have the use MID server set to true and the protocol set to https. This connection alias is referenced in an Action under "Connection Details". The action is called from a Flow that is tied to a catalog item. Hope that helps.

Thanks @Kevin Moore for the response.

Hello @KevinJ . Can you please provide complete updated procedure to able to create new shared mail box,add and remove users in sharedMailBox