Like I did here with Skype for Business, I’m collecting some observations and useful snippets about Exchange in hybrid environments.

Completing individual migration users

Recently we have been using the CompleteAfter flag in favour of the older SuspendWhenReadyToComplete to set a date for migration batches to complete. To update this timestamp for a single mailbox in a batch, we can use the following command:

Get-MoveRequest tom | Set-MoveRequest -CompleteAfter (Get-Date).AddHours(-1)

In the above example, the move request for the mailbox tom will be completed immediately without affecting other mailboxes in the batch.

Getting details about BadItems

Part of every migration are mailboxes with items that are either corrupt or cannot be imported to Exchange Online for some reason. Now if we don’t just increase the BadItemLimit counter but want more information about the corrupt items, we can get more information by using the -IncludeReport parameter with the Get-MigrationUser cmdlet:

$Stats = Get-MigrationUserStatistics -Identity [email protected] -IncludeReport 

Recipient Permissions

The *RecipientPermission cmdlets are used to manage SendAs permissions in Exchange Online. A nice goody of the Get-RecipientPermission cmdlet is the option to find permissions by assignee, i.e. by user to whom the permissions are granted. To get all entries that grant permissions to the user tom we use the -Trustee parameter like this:

Get-RecipientPermission -Trustee tom

Likewise, we can find all permissions by access right using the -AccessRights parameter. The following example gets all entries that grant SendAs permissions:

Get-RecipientPermission -AccessRights SendAs