Moving a mailbox from one user to another in Office365

[ IMPORTANT UPDATE March 2015:  Microsoft deprecated the procedure for moving mailboxes from one user to another which was described in this post and also removed the get-removedmailbox Powershell cmdlet on which it depended.  

The current approach to this seems to be built around the New-RestoreMailboxRequest powershell cmdlet, where the idea is that you take the mailbox that was deleted from user A and restore its content to a mailbox for user B.  

Microsoft’s current blog post discussing this topic can be found here.

The text that was originally on this page has been deleted because following those directions with today’s Exchange Online environment would result in data loss.  I have it on my to-do list to do some experimentation and document how to do this using today’s tools. ]


Author: Ken Hoover

A guy who likes to explore the boundaries of what systems can do when you bind them together and get them to cooperate.

11 thoughts on “Moving a mailbox from one user to another in Office365”

  1. Thanks for your post. Is there any way to move that mailbox to an existing user?
    I have some users that they are synced in office 365 with our internal domain. like although I have changed their UPN in AD to, still in office365 they are synced with so i have 2 of same user : which is synced and 2: in cloud. i want to change their UPN of the synced one in office 365 to manually and then delete their mailbox in cloud and move that mailbox to their synced username.
    hope I’ve explained it clear enough.

    1. Thanks for your comment. I think what you’re saying is that you have two copies of the same person in the cloud where one copy has the correct UPN but no mailbox and another copy has the wrong UPN and a mailbox and you want to associate the mailbox with the correct UPN.

      The solution may be as easy as changing the UPN’s on the two users. For the user that has no mailbox, either delete it or change its UPN to a non-conflicting value (such as one in the namespace). Then, change the UPN on the user that has the mailbox to the correct value.

      This avoids having to do this somewhat scary mailbox-move stuff. You can change UPN’s on Azure AD/Office365 users by using the set-msoluserprincipalname cmdlet. Hope this helps.

      1. The problem is that before I start to sync. I had in my AD and in office 365 with mailbox. after i synced with azure. I see with status: in cloud with mailbox as it was before another one with the same name with status synced with active directory.

        in my local active directory I have added the UPN:

        the weird thing is that some users although in my internal AD they were with , after sync in office 365 i have just one of them with right UPN

        but for a couple of users i have duplicate.

        if i change upn of the user from to and delete the one in cloud i will lose that mailbox and i need to assign new mailbox. I want to move the mailbox of to and then change the upn to @mydomain.

        sorry for long explanation, hope it can clarify.

  2. Introducing Dirsync to an existing O365 environment can be fairly complex if your cloud and on-premise domains, UPN’s and email addresses don’t fully align the way that Dirsync expects them to. You got the “extra” copy of the affected users in the cloud with UPN’s because of a mismatch . The AD user had a UPN that did not match a cloud user so Dirsync created a new cloud user.

    I still suggest deleting the Azure AD user (which has no mailbox, correct?) You will need to do this with Powershell using the remove-msoluser cmdlet since it is synced and the Office365 portal won’t let you delete a cloud user that’s synced with AD.

    Then verify that the UPN for the user in your on-prem AD exactly matches the UPN of the target user in the cloud and cycle Dirsync again. What should then happen is for Dirsync to realize that both user objects (in AAD and AD) represent the same identity and change the cloud user to a synced user as expected. This may take more than one Dirsync cycle to fully resolve but it doesn’t involve deleting a user with a mailbox and is therefore fairly safe.

    If you’re still stuck, you may want to open a ticket with Office365 support or we can talk about a direct engagement via my employer to look at your environment directly. My contact info can be found on the “About Me” link at the top.

  3. Thanks for the article. It helped my convert an DirSynced user to an on-line user and that was exactly what I needed to do.

    But what about archives, are they automatically moved as well following this procedure?



    1. I’m not sure, actually. This would be a good thing to test – create an O365 user with a mailbox plus an archive, run it through this process and see if the archive is still there on the new user.

    1. I updated the post with a warning at the top as soon as I learned of the change a couple of weeks ago (and nearly got burned by it myself). Since that apparently wasn’t enough, I’ve stripped the content from this page and left just the warning.

  4. Yup, I saw the warning right after I posted (of course). I’ve opened a ticket with Exchange Online support and will update you if they’re able to offer anything in the way of recovery. I’ve also learned a good lesson about not skipping right to the meat and potatoes…

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s