A closer look at the Create Resource Mailbox Problem

Microsoft released the following Hotfix for HMC 4.0 not too long ago,

You encounter problems when you create Exchange Resource Mailboxes in Hosted Messaging and Collaboration 4.0
https://support.microsoft.com/?id=957088

What’s the problem?

Now, as you can see in the article, there are a few things that it will fix. However, I want to take some time to focus on one, which is the CreateResourceMailbox problem covered in this hotfix.

As highlighted in the article, when you create Exchange Resource Mailboxes in Hosted Messaging and Collaboration (HMC) 4.0 by calling Hosted Exchange 2007:CreateResourceMailbox, the procedure will fail occasionally (not always). The error stack will show that it will fail calling the cmdlet, Set-MailboxCalendarSettings that is being called as part of Exchange 2007 Provider::CreateResourceMailbox.

It is also important to note that this problem is not limited to HMC 4.0 but it is also happening in HMC 4.5.

 What is causing this issue?

So, let’s look at the CreateResourceMailbox process and better understand what is running under the hood. The failure as you can see here happens when it is calling Exchange cmdlet. So, let’s look at what Exchange cmdlets are being called when you make that simple Hosted Exchange 2007::CreateResourceMailbox.

Hosted Exchange 2007::CreateResourceMailbox, like many other Hosted procedures, has a series of actions being triggered. One of them is the Exchange 2007 Provider::CreateResourceMailbox which will also call a series of cmdlets. The cmdlets being executed when you make that call to the provider are as follow,

  • Enable-Mailbox
  • Set-Mailbox – mainly to set the EmailAddressPolicyEnabled  to false 
  • Set-MailboxCalendarSettings

The problem happens when we are calling the cmdlet, Set-MailboxCalendarSettings. When it failed, it rolled back everything.

The issue is not because there is a problem with the above procedures. The problem is because Set-MailboxCalendarSettings somehow does not seem to take the domain controller parameter passed in. As a result, it may choose another domain controller. As you can see, when things happen so quickly, the domain controllers may not get fully replicated in time. Therefore, the Set-MailboxCalendarSettings may not be able to find the mailbox enabled object that it just enabled if it happens to hit a different domain controller than the one it enabled the mailbox earlier.

So, in short, it is more of an Exchange issue than a HMC problem. To prove it, try writing a PowerShell script to call the above cmdlets in one go, you will see that you may occasionally face issue with just that.

 What is the fix?

There are 2 things that I want to cover here very quickly,

1.       To really fix this issue, it has to be fixed in Exchange. From HMC perspective, in order to allow a more reliable mean of creating mailbox, a hotfix is provided by Microsoft. However, if you look at the article very carefully, this hotfix really is to provide a workaround.

It added an additional XML element to allow you to skip the Set-MailboxCalendarSetting (<skipMailboxCalendarSetting>1</skipMailboxCalendarSetting>) so that the creation will be successful. You can then make another call to make modification to the resource which will do the Set-MailboxCalendarSetting.

This way, you can at least create the resource mailbox first.

2.       HMC 4.5 did not have the fix until RU2. So, if you have problem creating resource mailboxes, you may want to apply RU2 and then consider using the workaround.