Fixing Exchange Online Hydration Issues With Enable-OrganizationCustomization

“Exception has been thrown by the target of an invocation” is an error you can see in Office 365 Rich Coexistence when you are first configuring the settings. There are other errors that can occur which also are the result of the same issue, for example I have seen “Error when getting bip rule” and “The user quota was exceeded“.
The error is due to the hydration status of your tenant at Office 365. Each Office 365 tenant is not “hydrated” by default. Hydration is the adding of lots of settings in the Exchange Online directory service per tenant – by default lots of tenants do not need these settings and so rather than creating the settings per tenant, each tenant shares these common settings.
To enable your own Transport Rules, preset security policies, Free/Busy Rich Coexistence and custom RBAC settings require that all the “common” settings in the directory are copied to the tenants area of the directory. To do this means you need to run the Enable-OrganizationCustomization cmdlet in remote PowerShell to Exchange online.
Once this is done the GUI will create RBAC, rules, free/busy etc. without throwing Exception has been thrown by the target of an invocation error.
The exact steps to perform on your Office 365 tenant before configuring RBAC, rules or coexistence are as follows:

  1. Start the Windows Powershell
  2. [once only] Import-Module ExchangeOnlineManagement
  3. Connect-ExchangeOnline
  4. Enable-OrganizationCustomization

Article updated over ten years later on Dec 2nd 2021 as this is still an issue in Exchange Online!




2 responses to “Fixing Exchange Online Hydration Issues With Enable-OrganizationCustomization”

  1. mark smith avatar

    I’m trying to allow calendar programs to subscribe to the calendars of the people in my organisaiton. This means they need to publish. When I try and alter the default sharing policy to allow full calendar sharing I get a hyrdration error.

    I presume it’s the same as the issue you describe here, and that if I enable this setting I’ll be ok….

    what if I’m on a mac? how can I run that cmdlet?



    1. Brian Reid avatar

      This cmdlets is run at Exchange Online. You need to connect to Exchange Online via remote PowerShell as detailed in the blog. I am not sure if PowerShell exists for the Mac. If it does, install and follow the steps. If not, this needs to be run from any internet connected PC or server.

      But yes, hydration issues are solved with this cmdlet and setting it is okay. All hydration does is make your settings on Exchange Online be editable for a series of less common scenarios. To save storage space in Azure AD, Microsoft make a lot of the less common settings read only and so they only store them once rather than once per tenant. Hydration copies these read only settings to your tenants Azure AD so that they become read/write.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.