Create Office 365 mailboxes while On Premise mailbox still exists

There are situations in which you want to create a office 365 mailbox on a AD synchronized account that still has an on premises mailbox. For instance when using 3rd party migration tools that require the office 365 mailbox to exist. Normally when assigning a office 365 exchange license to a user a mailbox is automatically created. When this user still has an on premises mailbox office 365 will not create a mailbox. A mailbox will only be created when the microsoft migration tools are used. Office 365 checks the existence of the msExchMailboxGuid attribute to determine whether an on premise mailbox exists.

PERFORM THESE STEPS AT YOUR OWN RISK!

We can alter the directory sychronisation so that the msExchMailboxGuid is no longer synchronised to Office 365. This can be done by performing the following:

  1. On the computer thats running the directory synchronisation tool.
  2. Navigate to C:\Program Files\Microsoft Online Directory Sync\SYNCBUS\UIShell
  3. Launch the application miisclient.exe
  4. Click on the management agents tab
  5. Open the properties of the Active Directory Connector
  6. Go to Configure Attribute Flow
  7. Expand Object Type: user in the Configure Attribute Flow section
  8. Scroll down to msExchMailboxGuid
  9. Click the Delete button to remove the mapping
  10. Click Ok to save the changes

If you already have synchronized objects in Office 365 these will still have the msExchMailboxGUID populated in Office 365. Since there is no way to use ADSIEdit on Office 365 objects we will have to do this with the directory synchronization tool.

The Azure Directory Synchronization tool is actually an installation of FIM (Forefront Identity Manager). I will not go into the specifics of how FIM works in this article but I will explain how to remove the msExchMailboxGUID value. FIM uses a metaverse to store the objects and attributes that are synchronized to Office 365. The metaverse is stored in a SQL database. We have removed the msExchMailboxGUID from the Active Directory Connector so it no longer populates the metaverse however for existing objects the value is still populated and will need to be removed. To do so follow these steps on the computer that’s running FIM:

  1. Install the SQL Express admin studio.
  2. Perform the following query:SELECT        userPrincipalName, msExchMailboxGuid
    FROM            mms_metaverse
    WHERE        (msExchMailboxGuid IS NOT NULL)This should return the user objects that still have the msExchMailboxGUI attribute populated.
  3. Perform the following Query to remove the msExchMailboxGUI from all users:
    UPDATE mms_metaverse SET msExchMailboxGuid = NULL WHERE (msExchMailboxGuid IS NOT NULL)
  4. Now that this is done we need to synchronize the changes to Office 365.
  5. Navigate to C:\Program Files\Microsoft Online Directory Sync\SYNCBUS\UIShell
  6. Launch the application miisclient.exe
  7. Click on the management agents tab
  8. Right-click on the Windows Azure Active Directory Connector and click Run.
  9. Perform a Full Import Full Sync.
  10. When the Full Import is finished perform an Export.
  11. Assign licenses to the accounts in Office 365. This should create the mailboxes.

This completes the procedure. Make sure that if you have to reinstall the Directory Sync tool onto another system to apply step 1 to 10 before running it.