Enabling Exchange Online Archive give error “Primary mailbox is located on an on-premises server”

So I’m deep in the throws of an Office 365 project, and after going thru the process of setting up Exchange Hybrid with on-premise ADFS, testing mailflow, and performing a mailbox move, the next step was working on Retention Policies to migrate email older than 1 year from their Primary Mailbox with 50gb storage to their Online Archive with 100GB of storage.

I tried to enable the archive from the Exchange Online portal as well as thru Exchange online Powershell but didn’t have any luck. With Powershell I was getting the message:

"Can't enable the archive for user because their primary mailbox is located on an on-premises server. To enable a cloud-based archive mailbox for this user, you must use your on-premises Exchange admin center or Exchange Management Shell."

I found this particularly odd because, well, the mailbox WASN’T on-premises any more nor was there any kind of archive mailbox enabled for my test acount.

After digging for hours (which is typically the catalyst for most of these posts) I came across a solution through the Office 365 community which detailed out adjusting the source AD user’s object on-premises attributes in order for the Archive to come online. Again, since this was a hybrid identity design, on-premises Active Directory was the source of truth and directory synchronization was in place to populate the objects in Azure AD / Office 365.

First, we need to modify the msExchArchiveName attribute to reflect the archive name (this can be whatever we want), as well as modify the msExchRemoteRecipientType to 3.

We’ll leave the msExchRecipientDisplayType and msExchRecipientTypeDetails as is – you can find what these means in a post I made here.

Once completed, force a Dirsync

Once complete, we run the Exchange Online powershell to see that the Get-Mailbox command to see the archive has been created

And that Outlook shows our online archive (with the name that we provided)

 

Chris Blackburn

Learn More →

12 thoughts on “Enabling Exchange Online Archive give error “Primary mailbox is located on an on-premises server”

  1. Tom August 7, 2015 at 11:53 am

    2 questions:

    1) Looking at your other post, if I’m moving a mailbox from On-Prem to the cloud then wouldn’t I want the remote recipient type to be 6 since that’s “Migrated mailbox from on-prem, ProvisionedArchive in EXO (mailbox migrated from on-prem & archive provisioned in Cloud)”

    2) Did you find a permanent fix for this problem or do you manually fix it on each affected user?

    Reply
    1. Chris Blackburn October 28, 2015 at 4:12 pm

      Hey Tom!

      I’ve found that these attributes are missing as well when you don’t provision a mailbox on-premises and move them up to the cloud.

      I’ve used this as a basis to build a Powershell script where, after creating the user in AD Users and Computers, that I populate these fields then perform a Dirsync.

      The users then appear properly in the Cloud and have consistency with the “source of truth”: on-premises Active Directory.

      I know, not the answer we want but hopefully long term we’ll see something that fits well with a Synchronized / Federated identity models.

      Reply
  2. Karim November 2, 2015 at 7:20 am

    Hi,

    Thank you for your post.
    Now fun fact, when changing those attributes, Exchange Online creates a local archive and not an archive in the cloud.

    Is there a possibility that a Exchange Online Archive is created instead of an OnPremise Exchange Archive?

    Reply
    1. Chris Blackburn November 3, 2015 at 11:47 am

      I can’t say that I’ve seen an on-premise mailbox being provisioned if the mailbox is in Exchange Online – I have seen it the other way around using other values for MsExchRemoteReipientType.
      Take a look at the list I have in another article Exchange Recipient Types and Office 365 – Setting Active Directory attribute values

      Reply
  3. Richard Jansman November 23, 2015 at 4:45 am

    Hi,

    I moved my mailbox from Exchange 2010 SP3 on premise to office 365 too. Got the same message. But solution is simple. Just go to your Exchange management shell on premise. Go to recipient configuration – Mail contact which contains a complete list of on premise mailboxes and office 365 mailboxes. Search your own mailbox which has another icon as on premises mailboxes.
    Just right click – Enable hosted Archive. Force start your Azure connect in the scheduled tasks (AD sync Scheduler task) of your AD connect server and you will see your online archive within a few minutes. Logon to Outlook again and you will see your online archive.

    Reply
    1. Chris Blackburn December 15, 2015 at 11:13 pm

      You make it sound too easy haha 😉 I have a few environments I help manage that actually have NO exchange install whatsoever after their Hybrid migration, so I needed an AD-only alternative.
      But yes – the GUI way is certainly doable as well!

      Reply
  4. Kevin Vanover January 24, 2016 at 8:37 am

    Chris,

    If the customer has the resources, I would recommend standing up an Exchange 2013/2016 Management Server, using the free license of course. It can be used to manage the attributes for AD Sync environments.

    Archive
    •Open EAC/recipients/mailboxes

    •Click on the mailbox

    •In the results pane click “Enable” under In-Place Archive, and then click “yes”

    •Wait for Azure Active Directory Sync to run or force a synchronization

    In Bulk (Run this cmdlet from the mgmt server)

    •Get-RemoteMailbox –ResultSize unlimited –Filter {(RecipientTypeDetails –eq ‘RemoteUserMailbox’)} | Enable-RemoteMailbox –Archive

    •Allow for two Azure AD Synch’s to occur (or force to manual sync’s)

    Reply
    1. Chris Blackburn May 25, 2016 at 9:12 am

      Excellent point as well – we’ve actually be recommending to customers to utilize the free license (which can be retrieved at https://configure.office.com/Scenario.aspx?sid=13) for a Hybrid Management Server, encompassing Exchange 2016, AD Connect, and the Remote Server Administration tools. This way, a large number of tasks can be automated, from a single AD users changes and AADSYNC synchronization jobs, by a single Powershell cmdlet.

      Reply
  5. Mike Thomas February 25, 2016 at 6:07 am

    I was able to do this using 2 methods

    Using the GUI on my exchange 2013 hybrid servers

    or using PS on the hybrid servers

    Enable-RemoteMailbox -Archive

    Reply
    1. Chris Blackburn March 15, 2016 at 4:37 pm

      I won’t lie, this article is somewhat dated after Microsoft has included this within the GUI of Exchange/Exchange Online!

      Reply
  6. exchange man April 20, 2016 at 9:27 am

    When i try to do this online under enable archive, i get the same message that i have to use on premise exchange/shell. We moved our mailboxes and then decommissioned our exchange server. can you give me a little more detail about how and where you are editing these properties?

    Reply
    1. Chris Blackburn May 25, 2016 at 9:06 am

      You would be making these command under AD Users & Computers for each object under the Attribute Editor tab (https://support.microsoft.com/en-us/kb/2028835) and modify the attributes from there.

      Reply

Leave a Reply to Mike Thomas Cancel 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.

css.php