M365 Mailbox and Archive Migrations - Performing Migration using only API permissions

This article provides all the necessary information to set up and perform a mailbox migration for a Microsoft 365 tenant. The approach outlined in the article is important to follow as it contains new information about the setup of the tenant, the application registration, the replacement of the Application Impersonation role in M365, and the assignment of permissions.

Retirement of Exchange Web Services in Exchange Online

Microsoft has announced that Exchange Web Services (EWS) requests will start to be blocked in M365 tenants with a phased, admin controllable disablement beginning on October 1, 2026, and a final retirement date of April 1, 2027. We recommend reviewing the information outlined in Microsoft’s announcement for additional details.

We are taking the necessary steps to transition to Microsoft Graph API and ensure continued service without disruption. The transition to Microsoft Graph API will be completed before the final retirement date of EWS. 

All migrations using EWS for Exchange Online (Microsoft 365) endpoints require following the steps under the Enable EWS Access in Exchange Online and Scoping EWS Access Before Retirement using EWSAllowedAppIDs sections of the migration guide for your particular migration scenario before you start your migration. These steps are required if your source, destination or both are Exchange Online (Microsoft 365).

Important

If you receive the following type of error in your project "Your migration failed while checking credentials. The request failed. The remote server returned an error: (403) Forbidden" check that you follow the steps correctly for Enabling EWS and adding your MigrationWiz EWS AppID to the EWSAllowedAppIDs list in your tenant using the steps below.

All PowerShell steps below use ExchangeOnline PowerShell and require a Global Admin to run the commands.

Enable EWS (Exchange Web Services) Access in Exchange Online

EWS access will be blocked if the following steps are not completed:

  • Enable EWS at Organization level
  • Enable EWS at User level
  • Add the EWS Application using the tenant to the EWSAllowedAppIDs list (see steps below) 

Ensure that the commands and steps below are followed to enable EWS in your tenant and prevent any unintentional interruptions to your migrations. For further information regarding this topic, please review the following Microsoft article. If you need assistance on this topic, please contact BitTitan's support team. 

Commands to Enable EWS at Organization-level:
# Check current status:
Get-OrganizationConfig | fl EWSEnabled 
# Enable EWS: 
Set-OrganizationConfig -EWSEnabled $true
 
Commands to Enable EWS at User-level:
# Check a specific mailbox 
Get-CASMailbox -Identity user@domain.com | fl EWSEnabled 
# Enable EWS for a specific mailbox 
Set-CASMailbox -Identity user@domain.com -EWSEnabled $true 
# Enable EWS for ALL mailboxes (use with caution) 
Get-CASMailbox -ResultSize Unlimited | Set-CASMailbox -EWSEnabled $true

Scoping EWS Application Access Before Retirement using EWSAllowedAppIDs

Important

You must complete the Modern Authentication app registration steps outlined in the Authentication Methods for Microsoft 365 (All Products) Migrations article before running the commands below. The Application (client) ID generated during that process is the App ID you will add to the allow list using the steps below.

In preparation for EWS retirement, Microsoft has introduced EWSAllowedAppIDs, a tenant-level allow list that restricts EWS access to only the applications you explicitly approve. To ensure MigrationWiz continues operating without interruption, the steps below are required as of August 6, 2026. Starting October 1, 2026, Microsoft will block all EWS traffic for tenants where EWSEnabled is set to True at Organization-level and User-level, but no EWSAllowedAppIDs list has been configured. Only applications whose App IDs appear in the EWSAllowedAppIDs list will be permitted to use EWS with MigrationWiz.

For further information on EWSAllowedAppIDs, review Microsoft's article Introducing EWSAllowedAppIDs: Preparing for the Final Phase of EWS Retirement.

Important Considerations Before Running any Commands

  • Changes to the allow list can take up to 24 hours to take effect. Exchange Online servers refresh their in-memory cache once every 24 hours. Plan accordingly and add your App IDs for your migration well ahead of time before testing your App IDs or starting your migration.
  • Verify after every change. Run the verify command after any add or remove operation to confirm the list is correct before assuming the change took effect.
Verify the Allow List:
Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Format-List EwsAllowedAppIDs
Note

The -RetrieveEwsOperationAccessPolicy parameter is required. The allow list is not returned by a standard Get-OrganizationConfig call.

Warning

Always run the above command first, before creating or modifying the Allow List to ensure there is not an existing list already. If you perform the steps for creating the Initial Allow List on an existing list, you may erase the App IDs already in that list. If you verify that the list already exists with App IDs, move down to the Add an App ID to an Existing List step.

If a pre-existing list of EWS App IDs are present, make sure you copy or safely store those IDs before making any modifications to the EWSAllowedAppIDs list in the case you need to re-apply the App IDs.

Create the Initial Allow List:

If no allow list exists yet, create one by specifying one or more of the MigrationWiz EWS App IDs in a comma-separated string. This replaces any existing value, so include all App IDs you want to permit in a single command.

Set-OrganizationConfig -EwsAllowedAppIDs "11111111-2222-3333-4444-555555555555,aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
 
Verify the Allow List:
Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Format-List EwsAllowedAppIDs

Important

Always verify the Allow List before and after making any modifications to your List.

If you need to add or remove an App ID for an already existing list, you must read the current list, compute the updated list, and then write the full value back using the Microsoft provided PowerShell commands below:

Add an App ID to an Existing List:

For $newAppId, use the App ID of the MigrationWiz EWS application for the project ("" included).

# Read the current allow list
$current = (Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Select-Object -ExpandProperty EwsAllowedAppIDs)
# Define the new App ID to add
$newAppId = "99999999-8888-7777-6666-555555555555"
# Combine existing and new values
$updated = @($current, $newAppId)
# Write the updated allow list back
Set-OrganizationConfig -EwsAllowedAppIDs ($updated -join ",")
 
Remove an App ID from an Existing List:

For $removeAppId, use the App ID of the MigrationWiz EWS application for the project ("" included).

# Read the current allow list
$current = (Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Select-Object -ExpandProperty EwsAllowedAppIDs)
# Define the App ID to remove
$removeAppId = "99999999-8888-7777-6666-555555555555"
# Split the comma-separated list into individual App IDs
$appIds = $current -split ","
# Remove the specified App ID
$updated = $appIds | Where-Object { $_ -ne $removeAppId }
# Write the updated allow list back
Set-OrganizationConfig -EwsAllowedAppIDs ($updated -join ",")

Important

The steps listed in this article do not scope the API permissions and will allow access to all user mailboxes in the tenant. Please review this article, for alternative steps that allow scoping of the API permissions to specific mailboxes only.

The quick checklist below outlines the basic steps covered in detail in this article. These steps allow for the process of replacing the application impersonation.

  1. Create a new Application Registration
  2. Assign the API Permissions and Grant Admin Consent
  3. Obtain the AppID and TenantID from the Application Registration
  4. Create a Client Secret
  5. Note regarding the Scoping Requirements 
  6. Set up your MigrationWiz Project

Important

The Application Impersonation is still a valid way to configure a MigrationWiz, however, Microsoft is already deprecating the ability to assign this role to tenants across the M365 architecture. Although it is still valid and will work where the role can be assigned to your tenant, it is recommended that the replacement method be used as a longer-term strategy for your migrations. This article concentrates on this new method as the default option in M365 Mailbox migrations.

MigrationWiz Video Guide

This step-by-step guide can be complemented with the video below. We recommend you review it if there is something you want to dive into.

Considerations

  • The following replacement should be followed for any O365 endpoints for O365 mailbox/archive mailbox projects. Depending on the case, these steps should be performed at both the source and the destination.
  • You can only perform the recommended replacement with Administrator credentials. If you use end-user credentials you should use the delegated permissions process. 
  • This guide does not apply to Public folder migrations.
  • The Use Impersonation to Authenticate checkbox must be enabled in your advanced options' Source/Destination tab.
    UseImpersonationcheck.jpg
    Otherwise, the following error might arise.
    ImpersonationErrorI (1).jpg
  • If you want to set up your environment for Exchange Online (Microsoft 365) to Exchange Online (Microsoft 365) using coexistence or to use the apply licenses feature in a regular Exchange Online tenant-to-tenant migration, please refer to this guide.

Step One - Create a New Application Registration

Create a new Application Registration in the Microsoft 365 tenant source or destination.

  1. Log in to the Microsoft Entra admin center with a Global Administrator login.
  2. Click View all products and select Microsoft ID (Azure AD) in the Microsoft Entra Admin Center.
  3. In the left sidebar, open the Applications dropdown list and select App Registrations, which is found under the Identity dropdown list.
  4. Select New Registration at the top of the screen.
    1. New App Registration.png
  5. Give the app a distinct name. You can change this later if necessary.
  6. Select the Accounts in this organizational directory only ('Tenant name only' - Single tenant) radio button.
  7. Click Register.
  8. Under the Manage menu, select Authentication (preview).
  9. Select the Settings tab.
  10. Set the option Allow public client flows to Enabled.
  11. Under the Supported Account types, select Accounts in this organizational directory only.
    New Entra ID Authentication UI.png

Step Two - Assign the API Permissions and Grant Admin Consent

The following steps allow you to assign the API permission and grant consent to the necessary M365 components.

  1. From the Manage menu, select API permissions.

    Important

    If an API permission is named User.Read under Microsoft Graph is already present, this can be removed. The Microsoft Graph API does not apply to this project type and is not used.

  2. Click Add a Permission.
    5. API Permissions_1.png
  3. Select APIs my organization uses.
  4. Scroll down or search for the following permissions Office 365 Exchange Online.
    5. Request API permissions_1.png
  5. Select Delegated Permissions.
  6. Select EWS.
  7. Check the box under EWS for EWS.AccessAsUser.All. 

    Important

    This permission only allows the OAuth application (MigrationWiz) to be associated with EWS. This does not grant access to all mailbox data.

  8. Click Add a Permission.
    6. Request API permissions_1.png
  9. Select APIs my organization uses.
  10. Scroll down or search for the Office 365 Exchange Online.
  11. Select Application Permissions.
  12. Check the box under Other Permissions for full_access_as_app.
  13. Click Add Permissions.
    7.1 Grant app permissions.png
  14. Click Grant admin consent.
    7.2.1 Grant permissions.png
  15. Click Yes to confirm the settings. Under the Status column, you should see a message that permission has been granted for the domain.

Step Three - Obtain the AppID and TenantID from the Application Registration

Follow the steps below to obtain the AppID and TenantID from the Application Registration.

  1. Navigate to the App Registrations item as shown below. In the Overview tab, you will find the Application (client) ID and the Directory (Tenant) ID.
  2. Copy both of these to another application, such as Notepad, for use later in this process. This is needed for the MigrationWiz Project Setup.
    3. Authentication Settings.png

Step Four - Create a Client Secret

Create a Client Secret for the application by following the steps below.

  1. Go to Manage > Certificates & secrets from the left sidebar.
  2. Create a new secret client by clicking + New client secret.
  3. Copy and save the client secrets' value on a notepad or other preferred tool.
    SecretValue.jpg

Warning

Consider that the secret client's value is only available until the first time you sign off the Azure Portal after the secret client creation. After that, it will be no longer visible. 
In case you lost the value, please create a new client secret as suggested above and use it in the steps below.

Step Five - Informational Note

The options provided in Step Two allow the Application Permissions to have full rights to read the mailboxes in the tenant. If you do not want this to be the case, please look at the M365 Mailbox and Archive Migrations - Scoping Option for API Permissions article on how to scope the application permissions to only allow access to a smaller set of mailboxes.

Step Six - Set up your MigrationWiz Project

Add the details from the Application Registration into the MigrationWiz project.

  1. Create your migration project.
  2. Set up your Endpoints. During this setup, you will be asked for:
    • Application (Client) ID - Obtained in Step Three
    • Directory (Tenant) ID - Obtained in Step Three
    • Client Secret - Obtained in Step Four

The correct Application and Directory IDs must be used, from the App Registration screen. These are NOT the values you used in running the ConfigureM365Tenant script above. They are obtained from Step Three and Step Four in these instructions.
M365ClientSecret.png

Important

The following support options will appear in the Advanced Options depending on the Microsoft 365 endpoints defined in your project.
 

  • ModernAuthClientSecretExport=xxxxxxxxxxxx Where the value is the client secret's value for M365 endpoints at the source.
  • ModernAuthClientSecretImport=xxxxxxxxxxxx Where the value is the client secret's value for M365 endpoints at the destination. 

These values can only be modified by editing your project's endpoints.

Having the Client Secret with a value in the dialog box notifies the system that you are using the new way of authenticating in the M365 environment. If you are still using the Application Impersonation method, then do not enter a client secret into this box.

Final Notes

The configuration will need to be performed on both the source and destination if they are Microsoft 365 endpoints. This entire process now supersedes the Application Impersonation requirements that have been present in these migrations for many years. As this old process is being deprecated across M365 tenants by Microsoft over the coming year it is highly recommended that this be the 'go-to' method for the setup of MigrationWiz projects from this point.

In case of any questions or concerns about this new method, contact our support team.

Related Topics

Was this article helpful?
9 out of 23 found this helpful