Office 365 Migration

Greate cmdlets to use during exchange migration

This powershell cmdlet requieres that you are connected to exchange online. It will list the status of all mailboxes beeing synced.

Get-MigrationUser -Status Syncing | Get-MigrationUserStatistics | ft Identity, PercentageComplete, State, TotalItemsInSourceMailboxCoun
t, BytesTransferred, EstimatedTotalTransfersize

Another cmd-let that gives some more detailed look

Get-MoveRequestStatistics -identity e-mailaddress

Replace emailaddress

Complete single mailboxes during migration;

Set-MoveRequest kak@kakster.dk -SuspendWhenReadyToComplete $false -PreventCompletion $false -CompleteAfter 5 | Resume-MoveRequest

Get a list of all mailboxes incl. totalitemsize og mailbox type;

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010;

$tt = Get-Mailbox

foreach ($item in $tt)
{
$cc = $item | Get-MailboxStatistics

$item | Add-Member -Name 'extended' -Value $cc -MemberType NoteProperty
}

$tt | select DisplayName, MailboxMoveRemoteHostName, UserPrincipalName, RecipientTypeDetails,HiddenFromAddressListsEnabled , @{ Label ='TotalItemSize'; Expression= {$_.extended.TotalitemSize} } | export-csv -Path C:\mailboxes.csv

Remove emailaddresses that are no longer used

$user = Get-Mailbox -ResultSize unlimited " |
%{
$EmailAddress = $_.EmailAddresses | Where-Object {$_ -notlike "*kakster.local"}
$_ | Set-Mailbox -EmailAddresses $EmailAddress
}
#Rewrite below
foreach ($_ in $user)
{

}

List mailbox missing sync jobs

Get-Mailbox | Where-Object { $_.MailboxMoveRemoteHostName -ne "kakster.onmicrosoft.com"} | select Name, OrganizationalUnit

List mailboxes detailed syncstatus

Get-MigrationUser -Status Syncing | select identifier | foreach {Get-MoveRequestStatistics -Identity $_.identifier

When migration failed due to LargeItem errors;

Set-MigrationBatch -LargeItemLimit 10

When there’s too many corrupted items

Set-MigrationBatch -BadItemLimit 10

Shared Mailboxe – Hybrid;

https://blogs.technet.microsoft.com/mconeill/2016/03/20/shared-mailboxes-in-exchange-hybrid-now-work-cross-premises/

Great registry settings;


[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Outlook\AutoDiscover]

"ExcludeScpLookup"=dword:00000001

"ExcludeHttpsRootDomain"=dword:00000001

"ExcludeHttpsAutoDiscoverDomain"=dword:00000001

"ExcludeHttpRedirect"=dword:00000000 (HVIS MSO365 BENYTTES)

"ExcludeSrvRecord"=dword:00000001

https://support.microsoft.com/da-dk/help/2212902/unexpected-autodiscover-behavior-when-you-have-registry-settings-under