ApplyMandatoryProperties

Recently I've gotten several questions about the "-ApplyMandatoryProperties" parameter on Set-Mailbox. Here's a quick overview of this parameter - what it does, why it does it, etc.

What does ApplyMandatoryProperties parameter do?

It applies the mandatory properties to the mailbox.

Ok then, wiseguy -- What are the mandatory properties?

Mandatory properties in this context is really referring primarily to the versioning and type metadata associated with the mailbox. It was intentionally named a little generically as "mandatory properties" in case there were other properties found later that also needed to be "applied" manually in some cases.

What actually happens when you "apply the mandatory properties"?

Applying the mandatory properties to a mailbox means that we run through the following algorithm:

1) Check whether the mailbox is hosted on E2k7 server by verifying its ServerLegacyDN (by the prefix “/o=<OrganizationName>/ou=<E2k7DefaultAdministrativeGroupName>/”)

2) If it is, we do both of the following things:

a. The ExchangeVersion is changed to Exchange 2007 ExchangeVersion value: "0.1 (8.0.535.0)"

b. The RecipientTypeDetails/RecipientDisplayType is updated according the value of “IsResource/IsLinked/IsShared”

3) Otherwise, we error out to tell that the task cannot do it because it is hosted on legacy server

The end result is that the mailbox will have its ExchangeVersion, RecipientTypeDetails, and RecipientDisplayType updated to match reality.

Why would you ever want to do this? Doesn't this happen automatically?

In most cases, yes it happens automatically. When you create a mailbox through Exchange 2007 tools, it happens automatically. When you create an Exchange 2003 mailbox with Exchange 2003 tools and move it to Exchange 2007, it happens automatically.

However, if you create an Exchange 2007 mailbox (meaning a mailbox hosted on an Exchange 2007 server) using the Exchange 2003 tools (ADUC), it will NOT happen automatically. Your new E2k7 mailbox will indicate that it's a "Legacy" mailbox and will therefore be blocked from using some of the great, new E2k7 features!

"Set-Mailbox -ApplyMandatoryProperties" against this incorrectly provisioned mailbox will set it straight, and it will thenceforth be recognized as the Exchange 2007 mailbox that it really is.

Isn't it totally unsupported to create E2k7 mailboxes with E2k3 tools?

Yes. See here for my earlier blog post on that topic. Unfortunately, while it's not supported -- and clearly doesn't work 100% -- ADUC doesn't provide a way to block the action so there's no way to prevent an administrator from trying. And the early feedback in the Exchange 2007 beta cycle was that there needed to be a way to "fixup" mailboxes that had been provisioned in this fashion. Enter the "-ApplyMandatoryProperties" switch.

Can I run ApplyMandatoryProperties against a mailbox where it's already been run?

Sure thing. You can run it again and it will just reset the values to the same (correct, and presumably current) value.