Failed mailbox migration from on-prem to O365

Hello,

Ran into a scenario where I have a failed migration batch that semi moved an Exchange 2013 user to O365. The mailbox did not migrate the data but did is currently working an receiving email. You can log into portal.office.com and click on mail and you will login to the users inbox and all incoming mail from the internet comes to this account. If a on-prem users sends email to this user it will go to the mailbox that is still on the on-prem Exchange. I remember running into this awhile back and I had a powershell command that I could tell on-prem Exchange that the user is now located on O365, however I can't find it searching isn't turning up the correct result. If you look at the on-prem EOA it shows the user as a local mailbox still compared to some of the O365 mailboxes. At this point we have a full extract of the email account and I would like to force the local Exchange to delete the mailbox and look at O365. Can anyone refresh my memory?

Thank you in advance
-Mike
LVL 5
BAYCCSAsked:
Who is Participating?
 
BAYCCSConnect With a Mentor Author Commented:
I was able to figure out the problem. I had to disable the user mailbox on-prem and use the command:

enable-RemoteMailbox  -Identity  <UserName>  -RemoteRoutingAddress  <UserName@domain.mail.onmicrosoft.com>

much easier and now the the user is showing as an O365 mailbox.
1
 
8046586Connect With a Mentor Commented:
Since you have your external domain present in your Exchange, all e-mails sent through your exchange will be routed internally. You have to remove the @yourdomain.com from the exchange and confirm that @yourdomain.com e-mail address is not present in the user mailboxes in exchange. This will solve your receiving in O365 and prevent missing internal communication.

You can always move the old e-mails from outlook. Archive the old mailbox in PST, create new Outlook profile linked to your O365 mailbox, import the archived PST.
0
 
BAYCCSAuthor Commented:
Hello Bocevski,

Thank you for your reply!

Yes I have already extracted the mailbox as a PST and plan to import it again one I get the account fixed. I understand that if I remove the email addresses from the internal user that will solve the mail-flow problem but how will Outlook auto discover work? Should I delete the onprem user in Exchange? I remember having to run a PS command to fix this for another user about a year ago but for the life of me I can't seem to find it. It basically told the onprem Exvhange that the mailbox is now on O365. Again, when I look at the users under mailboxes it shows this one user as "User" and not "Office 365".

Thanks,
Mike
0
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
8046586Commented:
The quick fix you can do is flushing DNS on your server and Desktops. I hope you have set up DNS forwarders to your ISP DNS servers. Adding a record to your DNS is a solution too. Just create "A" and "CNAME" records to all your external host addresses.
0
 
BAYCCSAuthor Commented:
Though your solution may work, This isn't the solution that I am looking for. I worry it may lead to some other problems down the line. I am kicking myself for not remembering this PS command to fix this.
0
 
8046586Commented:
Reading your question about the deleting users, I will try to reformulate my first message. When you do remove the external domain, you should set up your local domain as default for all users for as sending receiving domain. Naturally, when you were removing the external domain, you didn't select all e-mail addresses to delete for that domain. Do you still have email addresses with external domain still present in your mailboxes?
0
 
BAYCCSAuthor Commented:
No, I am not looking to remove email addresses technically. I have a hybrid Exchange environment and I was moving a mailbox to O365 and off of the on-prem server. The migration failed to complete and I have the user stuck showing as on-prem and in O365. I guess the best way to word this is that the mailbox is still showing as on-prem but is all activated and working in O365. I believe what I did last time I ran into this was delete the mailbox manually on the on-prem and then I had a PS command to tell AD/Exchange that the mailbox is now on O365. I just don't remember that command that I ran.
0
 
8046586Commented:
If you have set up as a primary your local domain to all users than you can delete the e-mails for your external domain from all users with this:

$domain = 'yourdomain.com'

foreach ($mbx in (Get-Mailbox | where { $_.EmailAddresses -like ('*@' + $domain) }))
{
    $addresses = $mbx.EmailAddresses
    $address = ($addresses | where {$_.PrefixString -eq 'SMTP' -and $_.AddressString -like ('*@' + $domain)})
    Write-Host ('Removing address ' + $address.addressstring + ' from mailbox ' + $mbx.Name)
    $addresses.Remove($address)
    Set-Mailbox $mbx -EmailAddresses $addresses
}
0
 
8046586Commented:
get-mailbox | where {$_.emailaddresses -like “*yourdomain.com”}

$users = get-mailbox | where{$_.emailaddresses -like “*yourdomain.com”}
foreach ($user in $users)
{
$addresses = (get-mailbox $user.alias).emailaddresses
$fixedaddresses = $addresses | where {$_.proxyaddressstring -notlike “*yourdomain.com”}
set-mailbox $user.alias -emailaddresses $fixedaddresses
}
0
 
FOXActive Directory/Exchange EngineerCommented:
BAYCCS,
I see you just had what we call a split-mailbox scenario, my question to you is after running your command, searching the recipient from the on prem server is that mailbox now showing up as a Remote User Mailbox?  All mail flowing correctly from internal and external senders?
0
 
BAYCCSAuthor Commented:
Hello FOX, yes it it. and everything is working good now. I also saved this in my notes for the next time that this happens. Migrations don't always go the way you plan... Also, thanks for letting me know that it is called a split-mailbox scenario.
1
 
FOXActive Directory/Exchange EngineerCommented:
Nice work.  That command may help me out.  I will try it in my next split scenario.  I usually have to pull all the mail from the mailbox that is in the cloud. Remove the mailbox in the cloud and remove it from the Recyle bin in the cloud, pump the mail in to the on prem mailbox and then remigrate to the cloud.
0
 
Marshal HubsEmail ConsultantCommented:
Stellar EDB to PST Converter also allows users to migrate mailboxes from Exchange 2013 user to O365. Just select user mailboxes, select office 365 option & enter O365 credentials. That's it. Download free demo version from here: https://www.stellarinfo.com/email-repair/edb-pst-converter.php
0
 
BAYCCSAuthor Commented:
Was able to use a different solution than what was suggested to me.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.