Prepare for Migrations

Before performing Exchange Online Migrations in Fly, follow the instructions below to prepare for the migration.

  1. Exchange Online Migration requires the availability of Exchange PowerShell for specific functions. Refer to Working with Exchange PowerShell for more details.

  2. Make sure the allowed item size of destination mailboxes is sufficient for the migration.

  3. Make sure the maximum received message size of the destination mailboxes is sufficient.

    Fly provides a script for you to easily configure the size for multiple mailboxes.

    1. Click and find the SetMaxReceiveAndSendSize.ps1 script and MailAddressList.csv file.

    2. Download the SetMaxReceiveAndSendSize.ps1 script and MailAddressList.csv file to the machine where you want to execute the script.

    3. Open the MailAddressList.csv file, and configure the email addresses of mailboxes in the MailAddress column and the size you want to set for the mailbox in the MaxReceiveSizeMB column.

    4. CSV file.

    5. Save the file.

    6. Locate and execute the SetMaxReceiveAndSendSize.ps1 script using Windows PowerShell.

    7. When the execution completes, you can view the report in the directory displayed in the window.

  4. Fly can remove source sensitivity labels and apply destination labels to emails with a corresponding option selected in the migration policy. Before using this feature, make sure to review the necessary requirements and additional information. Refer to Information about Managing Sensitivity Labels for details.

  5. Fly does not automatically provision new users in Microsoft 365. Make sure the destination users already exist before the migration.

    *Note: When the destination is a Microsoft 365 Multi-Geo tenant, and you want to provision a mailbox for a user in a specific location, you need to set the preferred data location for the user. Then, after the license is assigned to the user, the mailbox will be provisioned in the user’s preferred data location.

    There are different ways to add new Microsoft 365 users:

  6. To avoid destination users from viewing the newly added email addresses in the destination global address list (GAL) when the source mailboxes are still in use, and destination mailboxes are not put in use, you can refer to the following steps to hide users’ email addresses from the destination global address list:

    *Note: Only user/shared/resource/Microsoft 365 Group mailboxes can be hidden from the destination global addresses list.

    1. Click and find the HiddenUserOrGroupFromGAL.ps1 script and HiddenUserOrGroupList.csv file.

    2. Download the HiddenUserOrGroupFromGAL.ps1 script and HiddenUserOrGroupList.csv file to the machine where you want to execute the script.

    3. Open the HiddenUserOrGroupList.csv file, configure the email addresses and mailbox types of users/groups in the Address and Type columns as the screenshot shown below.

      HiddenUserOrGroupList.csv file.

    4. Save the file.

    5. Locate and execute the HiddenUserOrGroupFromGAL.ps1 script using Windows PowerShell.

    6. Enter H and press Enter on the keyboard to enable the HiddenFromAddressListsEnabled command to hide users from the destination GAL. Refer to for details about the command.

    7. Enter H and press Enter on the keyboard to enable the HiddenFromExchangeClientsEnabled command to hide groups from the destination GAL. Refer to for details about the command.

    8. When the execution completes, you can view the HiddenUserOrGroupList_Report_(TimeStamp).csv file generated in the directory displayed in the window.

      *Note: The execution will have no impact on the email address that has been hidden.

  7. If you want to synchronize the email addresses in the source Exchange global address list (GAL) to the destination, Fly provides the scripts to synchronize them. Note that the scripts can be used to sync the mail contacts in global contacts. If you want to migrate global contacts, sync the mail contacts first.

Complete the following steps to synchronize the source global address list to the destination:

1. Click and find the **GetMailContacts.ps1** and **AddMailContacts.ps1** scripts. 2. Download the **GetMailContacts.ps1** and **AddMailContacts.ps1** scripts to the machine where you want to execute the scripts. 3. Connect to your source Exchange environment using Windows PowerShell. Refer to for instructions. 4. Execute the **GetMailContacts.ps1** script in Windows PowerShell to retrieve the email addresses in the source global address list. Choose whether to retrieve email addresses of all mailbox types. Enter **Y** to retrieve email addresses of all mailbox types. ![Enter Y to get all mailboxes.](/en/fly-user-guide/perform-exchange-online-migrations/images/image35.png "Enter Y to get all mailboxes.") Enter **N** to choose whether to retrieve email addresses of each mailbox type. ![Enter N to decide the mailbox types you want to get.](/en/fly-user-guide/perform-exchange-online-migrations/images/image36.png "Enter N to decide the mailbox types you want to get.") 5. After the execution, a **MailContacts_(TimeStamp).csv** file will be generated in the same directory as the script. You can view the details of the retrieved email addresses in this file. 6. Replace the **MailContacts_(TimeStamp).csv** file name with **MailContacts.csv**. 7. Connect to your destination Exchange environment using Windows PowerShell. Refer to for instructions. 8. Execute the **AddMailContacts.ps1** script in Windows PowerShell to add retrieved source email addresses to the destination global address list. 9. If the email addresses already exist in the destination, the warning information will appear in the window, indicating that they cannot be added. 10. After the execution, an **AddMailContacts_Report_(TimeStamp).csv** file will be generated in the same directory as the script. You can view the details of both added and failed email addresses in this file. 11. Refer to the following steps to check whether the retrieved source email addresses are successfully added to the destination global address list: 1. Log in to your destination mailbox in Outlook. 2. Click **Home** tab and then click **New Email** in the **New** group. 3. Click **Message** tab and then click **Address Book** in the **Names** group. 4. Select **Global Address List** from the drop-down list. 5. Check whether the retrieved source email addresses are added to the destination global address list.

You can also delete the successfully synchronized source email addresses from the destination global address list.

To delete the successfully synchronized source email addresses, refer to the following steps:

1. Click and find the **DeleteMailContacts.ps1** script. 2. Download the **DeleteMailContacts.ps1** script to the machine where you want to execute the script. 3. Connect to your destination Exchange environment using Windows PowerShell. Refer to for details. 4. Execute the **DeleteMailContacts.ps1** script in Windows PowerShell to delete the successfully synchronized source email addresses from the destination global address list. If the email addresses do not exist in the destination, the warning information will appear in the window, indicating that they cannot be deleted. 5. After the execution, a **DeleteMailContacts_Report_(TimeStamp).csv** file will be generated in the same directory as the script. You can view the details of both deleted and failed email addresses in this file. 6. Refer to the following steps to check whether the successfully synchronized source email addresses are deleted from the destination global address list: 1. Log in to the destination mailbox in Outlook. 2. Click **Home** tab and then click **New Email** in the **New** group. 3. Click **Message** tab and then click **Address Book** in the **Names** group. 4. Select **Global Address List** from the drop-down list below **Address Book**. 5. Check whether the successfully synchronized source email addresses are deleted from the destination global address list.

Synchronize users via Microsoft Entra Cloud Sync

Before synchronizing users, you need to complete the prerequisites for Microsoft Entra cloud synchronization and install the Microsoft Entra Cloud. Refer to and for details.

Then, you can refer to the following sections to synchronize users.

Configure Microsoft Entra Cloud Sync

Refer to to configure Microsoft Entra Cloud Sync for provisioning from Active Directory to Microsoft Entra ID.

Configure Attribute Mapping

Refer to the following steps to map attributes between your on-premises user or group objects and the objects in Microsoft Entra ID:

  1. Log in to Microsoft Entra admin center (or Azure portal) and navigate to Microsoft Entra ID.

  2. Click Microsoft Entra Connect in the left panel. The Get started page appears.

  3. On the Get started page, click Cloud Sync in the left panel. The Configurations page appears.

  4. Click the desired configuration and click Attribute mapping in the left panel.

  5. Search MSExchMailboxGuid under the Users / InetOrgPersons tab.

  6. Click the Edit attribute mapping (Edit attribute mapping button.) button. The Edit attribute mappings page appears.

  7. Select Expression from the Mapping type drop-down list, enter "" in the Expression text box, and click Apply.

  8. Edit attribute mappings page.

  9. Check to make sure the source attribute of MSExchMailboxGuid is empty.

  10. Attribute mapping page.

Configure Scoping Filters

Refer to the following steps to configure a scoping filter to define the synchronization scope:

  1. Log in to Microsoft Entra admin center (or Azure portal) and navigate to Microsoft Entra ID.

  2. Click Microsoft Entra Connect in the left panel. The Get started page appears.

  3. On the Get started page, click Cloud Sync in the left panel. The Configurations page appears.

  4. Click the desired configuration and click Scoping filters in the left panel.

  5. Select the synchronization scope. If you select Selected security groups or Selected organizational units, enter the corresponding distinguished name in the text box. To get the distinguished name of a security group or organizational unit, refer to the Get the Distinguished Name using Windows PowerShell section below.

  6. Click Add to add the distinguished name and click Save to save the scoping filters.

Get Distinguished Names using Windows PowerShell

Refer to the following instructions to get the distinguished name of a security group or organizational unit:

- **Security groups** – Open Windows PowerShell, and enter the following command: `Get- ADGroup -Identity "sync user" | Format-Table Name, DistinguishedName -A` Replace **sync user** with the display name of the group and press **Enter** on the keyboard. ![Distinguished name of a security group.](/en/fly-user-guide/perform-exchange-online-migrations/images/image40.png "Distinguished name of a security group.") - **Organizational units** – – Open Windows PowerShell, enter the following command window: `Get- ADOrganizationalUnit -Filter 'Name -like "OU1"' | Format-Table Name, DistinguishedName -A` Replace **OU1** with the display name of the organization unit and press **Enter** on the keyboard. ![Distinguished name of an organizational unit.](/en/fly-user-guide/perform-exchange-online-migrations/images/image41.png "Distinguished name of an organizational unit.")

On-demand Provisioning (Optional)

Refer to to check whether users in the synchronization scope can be correctly synchronized to Microsoft Entra ID.

To get the distinguished name of a user, open Windows PowerShell and enter the following command:

Get- ADUser -Identity "Kuser1" | Format-Table Name, DistinguishedName -A

Replace Kuser1 with the display name of the user and press Enter on the keyboard.

Distinguished name of a user.

Synchronize Users

Refer to to synchronize users. Then, you can check the sync status of users in Microsoft 365 admin center > Users > Active users. After assigning Exchange Online license to the user, the mailbox of the user will be automatically initialized.

Sync status.

Synchronize users via Microsoft Entra Sync or Microsoft Entra Connect

Refer to the following sections to synchronize users from local Active Directory to Microsoft 365 via Microsoft Entra Sync or Microsoft Entra connect:

Synchronize All Users

Refer to the following steps to synchronize all users:

  1. Install Microsoft Entra Sync or Microsoft Entra Connect (if you need support for federation).

    *Note: Make sure msExchMailboxGuid is set to Null before the synchronization. Only after you change the msExchMailboxGuid attribute value can a user mailbox be created when an Exchange license is assigned.

    To set the msExchMailboxGuid to Null, complete the following steps. Note that the following steps will synchronize all users from the local Active Directory to Microsoft 365. If you only want to synchronize a part of the users to Microsoft 365, refer to Set a Filter Rule and Synchronize Included Users below to set a filter rule and only synchronize the users included in the filter rule.

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange and click Edit.

      The Synchronization Rules Editor window

    3. In the pop-up window, click Yes to edit the current rule.

      The pop-up window

    4. In the Edit Inbound Synchronization Rule window, change the Precedence value to 1.

      The Precedence value in the Description group

    5. Select Transformations in the left pane, and find the msExchMailboxGuid attribute.

      The msExchMailboxGuid attribute

    6. Complete the following settings for the msExchMailboxGuid attribute:

      • Select Expression for the FlowType column.

      • Enter NULL for the Source column.

      • Select the Apply Once checkbox.

      • Select Update.

    7. Click Save to save the settings. The In from AD – User Exchange Cloned rule is automatically created, and the original In from AD – User Exchange rule is automatically disabled.

  2. Run Microsoft Entra Sync or Microsoft Entra Connect to synchronize users from the local Active Directory to Microsoft 365.

  3. After the synchronization, re-enable the original In from AD – User Exchange rule using the Synchronization Rules Editor. Refer to the following steps to re-enable the original In from AD – User Exchange rule:

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange – Cloned and click Delete.

    3. In the pop-up window, click Yes to delete the current rule.

      The In from AD – User Exchange - Cloned rule

    4. Select the original In from AD – User Exchange rule and click Enable.

      The original In from AD – User Exchange rule

    5. Assign Exchange Online licenses to the users.

Set a Filter Rule and Synchronize Included Users

Refer to the following steps to set the filter rule and only synchronize the users included in the filter rule:

  1. In the Exchange Admin center, edit the mailbox whose user you want to synchronize, choose a custom attribute for the mailbox and specify a tag for the mailbox. For example, choose attribute 5 and enter FLYMigration as the tag.

    Enter FLYMigration.

    Repeat this step to add the custom attribute for more mailboxes.

    To add the custom attribute for mailboxes in bulk, you can also run PowerShell as an administrator, and configure the Set-Mailbox <email address> -customAttribute “attributevalue” command for each mailbox by defining the mailbox email address, custom attribute number, and custom attribute value. Refer to the screenshot below, for example:

    Example for configuring custom attribute

  2. Run the Synchronization Rules Editor as an administrator.

  3. Select In from AD – User Exchange and click Export to export the rule to a .txt file. Edit the file extension to change the .txt file to a .ps1 file.

    The Synchronization Rules Editor window

  4. Open the exported .ps1 file, customize the Name attribute, change the Precedence attribute value to equal or less than 100, and delete the identifier and ImmutableTag attributes.

  5. Run the exported .ps1 file with Windows PowerShell to create the rule in Synchronization Rules Editor.

  6. Select the newly created rule and click Edit.

  7. Select Scoping filter and click Add clause to add the filter condition. Choose the extensionAttribute5 under Attribute. Select EQUAL under Operator and enter FLYMigration as the attribute value.

    filter condition

    Repeat this step to add more filter conditions according to step a.

  8. Select Transformations in the left pane, and find the msExchMailboxGuid attribute.

    The msExchMailboxGuid attribute

  9. Complete the following settings for the msExchMailboxGuid attribute:

    • Select Expression for the FlowType column.

    • Enter NULL for the Source column.

    • Select the Apply Once checkbox.

    • Select Update.

  10. Click Save to save the settings.

  11. Select the original In from AD – User Exchange synchronization rule, and click Edit to edit the rule.

  12. In the pop-up window, click Yes to edit the rule.

    The pop-up window

    The In from AD – User Exchange Cloned rule is automatically created, and the original In from AD – User Exchange rule is automatically disabled.

  13. Select Scoping filter and click Add clause to add the filter condition. Choose the extensionAttribute5 under Attribute. Select NOTEQUAL under Operator and enter FLYMigration as the attribute value.

    filter condition

    Repeat this step to add more filter conditions according to step a.

  14. Click Save to save the settings.

  15. Run Microsoft Entra Sync or Microsoft Entra Connect to synchronize users from the local Active Directory to Microsoft 365. Only the mailbox users included in filter conditions are synchronized.

  16. After the synchronization, re-enable the original In from AD – User Exchange rule using the Synchronization Rules Editor. Refer to the following steps to re-enable the original In from AD – User Exchange rule:

    1. Run the Synchronization Rules Editor as an administrator.

    2. Select In from AD – User Exchange – Cloned and click Delete.

    3. In the pop-up window, click Yes to delete the current rule.

      The In from AD – User Exchange - Cloned rule

    4. Select the original In from AD – User Exchange rule and click Enable.

      The original In from AD – User Exchange rule

    5. Assign Exchange Online licenses to the users.