Migrating Mailboxes From On-Premises to Office 365

KB ID 0001419

Problem

This post continues from Part-One where we connected both our domain, and on-premises Exchange server to Office 365. Now we will add our public domain, and migrate our mailboxes.

Step 3 Adding Domains to Office 365

Before proceeding you will need administrative access to your public DNS records so you can create new records.

Log into Office 365 > Admin Console.

Add a domain.

Enter your public domain name > Next.

Now you need to create a ‘Text Record” in you public domain, the TTL does not really matter but the TXT value must match exactly.

As below, once created click (Verify).

Ill manage my own DNS records > Next.

We are only concerned with Exchange > Next.

STOP: These are the DNS records you need to create if you want everything to point to Office 365, DO NOT CREATE THEM if you want your mail to still get routed to your on-premises, and you want your Autodiscover to point there. I leave everything pointing to my on-premises server!

So I DON’T create the records (below) unless I’m about to decommission an on-premises Exchange server.

If you DID want all mail and auto discover to route to Office 365 that’s fine BUT change the SPF record that Microsoft gives you to include the public IP of your on-premises server of you may start getting mail blocked.

i.e.

Microsoft Suggests: “v=spf1 mx include:servers.mcsv.net ?all”

Use: “v=spf1 ip4:123.123.123.123 mx include:servers.mcsv.net ?all”

Finish.

Test Mail Flow

If you have made any public DNS changes, then before you do anything else, make sure mail continues to flow in and out of your on-premises Exchange organisation as it did before!

Step 4 Mailbox Migration

Log into Office 365 and locate a user to perform a test migration on, then allocate them an office 365 licence.

Then from the Office365 Admin Center > Recipients > Migration > Add > Migrate to Exchange Online > Remote move migration > Next.

Add in your ‘Test user’ > Next.

Supply your Exchange administrative credentials > Next.

Put in your MRS proxy FQDN > Next

Note: You may see the following error

MRS Proxy Error ‘The connection to the server could not be completed’

Give the batch a name > Next.

Select an email address to be sent a migration report, Note: For the test migration I’m leaving it on ‘Manual Complete’ once Im happy I would select ‘Automatically Complete’ > New.

You can view a ‘hight level’ progress, or click the download link;

To view a more detailed report.

Note: You can connect to O365 PowerShell online, and view the migrations from command line like we normally do with an on-premises mailbox migration. See the following link;

Connect to Office 365 Exchange PowerShell

When finished complete the migration.

Migration completed.

Viewing the same thing from PowerShell;

Now test mallow in/out from on-premises and from Office365, then make sure mail also flows between on-premises and Office 365 (both ways).

Make sure calendar sharing scheduling also works between on-premises and Office 365 mailboxes.

Once you are happy, you can migrate the rest of the mailboxes.

 

Related Articles, References, Credits, or External Links

NA

Exchange: PowerShell Commands

KB ID 0001405

Problem

This might seem like an odd title for an article here at PNL? But I’m going to use this page as a place to put all the commands I’m sick of Googling for, and/or working out every time I do an Exchange job.

So as with all the posts here, it’s here for my benefit, and if anyone else gets something from it great!

Exchange General

Change Exchange Licence Code

[box]Set-ExchangeServer -Identity Server-Name -ProductKey 12345-12345-12345-12345-12345[/box]

Exchange Mailboxes

How Many Mailboxes Per Database?

[box]Get-Mailbox | Group-Object -Property:Database | Select-Object Name,Count | Sort-Object Name | Format-Table -Auto[/box]

 

Exchange Mailbox Migrations

Migrate a Single Mailbox

[box]New-MoveRequest -Identity “Fred Bloggs” -TargetDatabase “Destination-DB” -BatchName “Fred Bloggs” -BadItemLimit “200” -AcceptLargeDataLoss[/box]

Migrate ALL Mailboxes in one Database to Another

[box]Get-Mailbox -Database “Source-DB” ” -ResultSize Unlimited | New-MoveRequest -TargetDatabase “Destination-DB”[/box]

Display Mailbox Migration Progress

[box]Get-moverequest | get-moverequeststatistics

OR

Get-moverequest -MoveStatus InProgress

Get-moverequest -MoveStatus Failed

Get-moverequest -MoveStatus Queued

[/box]

Remove Mailbox Move Requests

[box]Get-MoveRequest -MoveStatus Completed | Remove-MoveRequest[/box]

Exchange Databases

List All Mailboxes in a Database

[box]Get-Mailbox -Database “Database Name“[/box]

Create a Mailbox Database 

[box]New-MailboxDatabase -Name Database-Name -EdbFilePath X:\Folder\Database\Database-Name.edb -LogFolderPath X:\Folder\Log-Folder\[/box]

Show Database (and Log File) Locations

[box]Get-MailboxDatabase -Status | select EdbFilePath
Get-MailboxDatabase -Status | select LogFolderPath[/box]

Move a Database (and Log Files)

[box]Move-DatabasePath -Identity Database-Name -EdbFilePath X:\Folder\Database\Database-Name.edb
Move-DatabasePath -Identity Database-Name -LogFolderPath X:\Folder\Log-Folder\[/box]

Show Mailbox Database ‘Whitespace’

[box]Get-MailboxDatabase -Status | select Name,DatabaseSize,AvailableNewMailboxSpace[/box]

Users and Groups

Exchange Create a Distribution Group

[box]New-DistributionGroup -Name “DG-All-Users” -Type “Security”[/box]

Exchange Add All Users (In an OU) to a Distribution Group

[box]Get-Mailbox -OrganizationalUnit “cn=users,dc=petenetlive,dc=com” -resultsize unlimited|ForEach-Object { Add-DistributionGroupMember -Identity “DG-All-Users” -Member $_ }[/box]

 

Related Articles, References, Credits, or External Links

NA