{"id":2089,"date":"2017-04-14T19:30:38","date_gmt":"2017-04-14T19:30:38","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2089"},"modified":"2019-05-02T17:00:45","modified_gmt":"2019-05-02T17:00:45","slug":"unable-to-migrate-user-to-o365-target-user-already-has-a-primary-mailbox","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2089","title":{"rendered":"Unable to Migrate User to O365 \u2013 &#8220;Target user already has a primary mailbox&#8221;"},"content":{"rendered":"<p>If you run into an issue where a user has both a mailbox in Exchange on-premise and O365, and you cannot migrate the account to O365.<\/p>\n<p>Error: &#8220;Target user already has a primary mailbox&#8221;<\/p>\n<p>FIX:<\/p>\n<p>Remove the O365 account and then do a full DirSync.\u00a0 Once done, migrate the on-prem mailbox to O365.<\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li data-aria-posinset=\"1\" data-aria-level=\"2\"><span style=\"color: #ff6600;\"><b>Open PowerShell in Connect-MSOLService -Credential $adminCredential\u00a0\u00a0 (enter <\/b><b>ADAuser@company.com<\/b><b> credentials)<\/b>\u00a0<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<ol>\n<li data-aria-posinset=\"2\" data-aria-level=\"2\"><span style=\"color: #ff6600;\"><b>remove-MSOLUser -UserPrincipalName USER<\/b><b>@company.com<\/b>\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #ff6600;\">Confirm<\/span><\/p>\n<p><span style=\"color: #ff6600;\">Continue with this operation?<\/span><\/p>\n<p><span style=\"color: #ff6600;\">[Y] Yes\u00a0 [N] No\u00a0 [S] Suspend\u00a0 [?] Help (default is &#8220;Y&#8221;): y<\/span><\/p>\n<ol>\n<li data-aria-posinset=\"1\" data-aria-level=\"2\"><span style=\"color: #ff6600;\"><b>remove-MSOLUser -UserPrincipalName USER<\/b><b>@company.com<\/b><b> -RemoveFromRecycleBin<\/b>\u00a0<\/span><\/li>\n<\/ol>\n<p><span style=\"color: #ff6600;\">Confirm<\/span><\/p>\n<p><span style=\"color: #ff6600;\">Continue with this operation?<\/span><\/p>\n<p><span style=\"color: #ff6600;\">[Y] Yes\u00a0 [N] No\u00a0 [S] Suspend\u00a0 [?] Help (default is &#8220;Y&#8221;): y<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>**Run a Full DirSync, once completed then try to migrate the user to O365 again.<\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you run into an issue where a user has both a mailbox in Exchange on-premise and O365, and you cannot migrate the account to O365. Error: &#8220;Target user already has a primary mailbox&#8221; FIX: Remove the O365 account and then do a full DirSync.\u00a0 Once done, migrate the on-prem mailbox to O365. Open PowerShell [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,60,59],"tags":[],"class_list":["post-2089","post","type-post","status-publish","format-standard","hentry","category-exchange-2010","category-office-365","category-powershell"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2089"}],"version-history":[{"count":2,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2089\/revisions"}],"predecessor-version":[{"id":2788,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2089\/revisions\/2788"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}