Home > Perform Gmail Migrations > Delete Data from Exchange Online

    Export to PDF

    Delete Data from Exchange Online

    Fly provides a tool for you to delete data from Exchange Online archive/user/Microsoft 365 Group mailboxes. You can click the to download the FlyMailboxDataDeletion tool.

    Before running the FlyMailboxDataDeletion tool, you need to make the following preparations:

    - A service account with the **Full Access** permission or a custom app profile with the **full_access_as_app** permission is configured in your tenant. To delete data from Microsoft 365 Group mailboxes, also make sure the custom app profile have the **Microsoft Graph** > **GroupMember.Read.All** and **User.Read.All** permissions. - To use a service account, make sure the **Security defaults** setting is disabled in your tenant. Otherwise, the service account authentication will be blocked. - To use a custom app, copy the application (client) ID and the client secrets of the app for later use. You can navigate to Microsoft Azure > **App registration** and click the desired app to find the client ID in the **Overview** section, and find the client secrets in the **Certificates &** **secrets** section.  - The litigation hold and single item recovery are disabled in the related mailboxes. To disable the litigation hold and single item recovery, open Windows PowerShell, enter the following command, and press **Enter** on the keyboard to execute the command:

    Set-Mailbox -Identity user@contoso.com -SingleItemRecoveryEnabled $false -LitigationHoldEnabled $false

    Refer to the following steps to run the FlyMailboxDataDeletion tool to delete data from Exchange Online:

    1. Extract the downloaded ZIP file. Open the MailAddress.csv file in the folder and configure the data you want to delete as follows:

    2. *Note: Configure each mailbox in one row and make sure all mailboxes you configured are in the same tenant.

      MailAddress.csv file.

      • user1@consoto.com(In-Place Archive Mailbox) – The data in the archive mailbox (user1@contoso.com) will be deleted, but the data in the Purges folder of the mailbox will not be deleted.

      • user1@consoto.com(In-Place Archive Mailbox)\folder1\folder2 – The folder2 of the archive mailbox (user1@contoso.com) will be deleted.

      • user1@consoto.com(In-Place Archive Mailbox)\Recoverable Items\Purges – The data in the Purges folder of the archive mailbox (user1@contoso.com) will be deleted.

      • *Note: If you want to delete all data from the archive mailbox, including the data in the Purges folder, we recommend that you delete the data from the Purges folder before deleting other data.

      • user2@contoso.com – The data in the user/group mailbox (user2@contoso.com) will be deleted.

      • *Note: For a user mailbox, the data in the Purges folder of the mailbox will not be deleted.

      • user2@contoso.com\folder1\folder2 – The folder2 of the user/group mailbox (user2@contoso.com) will be deleted.

      • user2@consoto.com\Recoverable Items\Purges – The data in the Purges folder of the user mailbox (user2@contoso.com) will be deleted.

      • *Note: If you want to delete all data from the user mailbox, including the data in the Purges folder, we recommend that you delete the data from the Purges folder before deleting other data.

    3. Save the file.

    4. Open the FlyMailboxDataDeletion.exe file with Notepad and configure the following nodes:

      • – Define whether to delete scanned data. Enter True or False as the value.

        • True – Only scan the specific data and do not delete them.

        • False – Scan the specific data and delete them.

        • *Note: Scanned empty folders will also be deleted.

      • – Define the data scanning scope. Enter All, Exists, or NotExists as the value.

        • All – Scan/delete all data in the destination, including destination original data and data migrated from the source.

        • Exists – Only scan/delete the data migrated from the source.

        • NotExists – Only scan/delete the destination original data.

      • – Define whether the job is to delete data from Microsoft 365 Group mailboxes. Enter True or False as the value.

        • True – Fly Server will delete data from Microsoft 365 Group mailboxes.

        • False – Fly Server will delete data from archive/user mailboxes.

    5. Save the file.

    6. Right-click the FlyMailboxDataDeletion.exe file and select Run as administrator to run the tool.

    7. Enter A/a/S/s and then press Enter on the keyboard to select the authentication method.

    8. Fly_Server_Folder_Data_Deletion.exe.

      • If you use an application, complete the following steps to run the tool:

        1. Enter the client ID of the app and then press Enter on the keyboard.

        2. Enter the secret of the app and then press Enter on the keyboard.

        3. Fly_Server_Folder_Data_Deletion.exe.

      • If you use a service account, complete the following steps to run the tool:

        1. Enter the username of the service account and then press Enter on the keyboard.

        2. Enter the password of the service account and then press Enter on the keyboard.

          Fly_Server_Folder_Data_Deletion.exe.

    After running the tool, you can find the report named FlyMailboxDataDeletion_ TimeStmap.csv in the same directory as the tool, and the logs named FlyMailboxDataDeletion.exe_TimeStamp.log and FlyMailboxDataDeletion.exe_TimeStamp_High.log in the Logs folder of the same directory as the tool.

    If errors occur while running the tool, you can contact AvePoint Support and provide the job logs and job reports to analyze the errors.

    1.