We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to Remove the mailbox Access for the offboarding user via Automation

Atiruveedula
Kilo Explorer

Hi all,

I'm building an employee offboarding automation in Flow Designer (Zurich) using the Microsoft Exchange Online spoke. As part of offboarding I need to:

1. Remove the leaver's access (Full Access and Send-As) to any shared mailboxes they had.
2. Convert the leaver's own mailbox to a shared mailbox.

I've gone through the Exchange Online spoke's action list and I can't find OOTB actions for either - there's no "Update Mailbox", "Set Mailbox Type", "Convert to Shared", or "Remove Mailbox Permission" action. I do have working actions like Set Mailbox Auto-Reply, Look up Mailbox, and Delete Mailbox.

My understanding from other threads is that mailbox permissions and mailbox-type conversion aren't in Microsoft Graph, so these have to be done via Exchange Online PowerShell (Remove-MailboxPermission, Remove-RecipientPermission, Set-Mailbox -Type Shared) which means running PowerShell on the MID Server.

Questions:
1. Is there genuinely no OOTB action for these in the current Exchange Online spoke, or am I missing something?
2. For those who built custom actions - did you copy an OOTB PowerShell-based action (e.g. Look up Mailbox) and swap in the cmdlet? Any working example or gotchas?
3. What exactly needs to be in place on the MID Server for this - the EXO PowerShell module (V2/V3) plus an Exchange admin service account authenticating through the MID Server? Any auth issues to watch for?
4. For removing shared mailbox access when you don't have a pre-known list, how did you discover which shared mailboxes a user had access to - is there a practical approach that isn't enumerating every mailbox?

Environment: ServiceNow Zurich, Exchange Online (Microsoft 365, cloud-only), MID Server available.

Thanks in advance - keen to hear how others structured this for offboarding.

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @Atiruveedula 

 

IntegrationHub does not provide a dedicated Spoke for every Exchange Online operation.

 

You'll need to work with your Exchange Online team to create the required PowerShell script first. Once the script is ready, you can execute it using the PowerShell Script Spoke in IntegrationHub.

 

Refer:

Exchange Online Integration 

Integration Hub - Exchange Online Spoke Setup - Mailbox Actions 

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti