Blog Post

Exchange Team Blog
6 MIN READ

Notes from the field: testing EWSAllowedAppIDs safely

The_Exchange_Team's avatar
The_Exchange_Team
Platinum Contributor
Aug 20, 2026

As customers prepare for the final phase of Exchange Web Services (EWS) retirement in Exchange Online, many are asking the same practical question: how can I prove that EWSAllowedAppIDs is working before I depend on it? This field guide walks through a controlled positive-and-negative test, explains what the result means, and highlights an important naming trap that we are already seeing in customer conversations.

A note from the field

The most common confusion is not about the PowerShell syntax. It is about two similarly named controls that operate at different layers. EWSAllowedAppIDs is the new application-ID control for EWS. The older EWSAllowList and EWSBlockList settings are user-agent controls associated with EwsApplicationAccessPolicy, and they can affect both EWS and REST traffic.

Understand the two controls before testing

EWSAllowedAppIDs is a tenant-level list of application (client) IDs. When EWS is enabled and the list contains one or more Application IDs, only the listed applications are permitted to access EWS. This is the control to validate when you are testing an application's EWS access during the retirement transition.

EWSAllowList and EWSBlockList are older, user-agent-based controls. Despite their names, the underlying access policy is not limited to EWS; it will also affect REST requests. Customers that already use these settings may still need them for REST access control after EWS retirement.

The controls are evaluated independently. In practical terms, an EWS request must pass the application-ID control and then any applicable user-agent control. A successful App-ID test therefore does not prove that a separate user-agent policy is configured correctly.

What the test proves

A valid before-and-after test demonstrates the EWSAllowedAppIDs behavior only when all of the following are true:

  • The application can obtain an OAuth token.
  • The application has EWS application permission and tenant-wide admin consent.
  • EWSEnabled is set to True for the test.
  • The test mailbox contains at least one item in the Inbox.
  • The App ID is present for the positive test and absent for the negative test.
  • At least 24 hours has elapsed after each allow-list change.

Before you start

Perform this procedure in a test tenant if you can. Removing an application from the list can stop a production workload from accessing EWS after the configuration change has propagated.

Prepare the following:

  • A test mailbox with at least one Inbox item.
  • An app registration in the same tenant as the mailbox.
  • EWS application permission with tenant-wide admin consent.
  • A client secret or certificate for application authentication. Treat a client secret as a password and do not place it in a shared script or source-control repository.
  • Exchange Online PowerShell access and permission to run Get-OrganizationConfig and Set-OrganizationConfig.
  • Download the Test-EWSAppAccess.ps1 script. This is a test script that you can use unless you want to test with a real app. Script documentation can be found at Testing EWS App Access.

Record the tenant ID, application (client) ID, test mailbox SMTP address, and the selected authentication material before starting.

Test 1: Confirm access while the app is allowed

  • Connect to Exchange Online PowerShell.
Connect-ExchangeOnline
  • Inspect the current EWS state and capture the complete existing App-ID list.
Get-OrganizationConfig | Format-List EWSEnabled
Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Format-List EwsAllowedAppIDs
  • For a controlled test, set EWSEnabled to $null (all EWS allowed, AppID Allow List ignored).
Set-OrganizationConfig -EWSEnabled $null
  • Add the test App ID without overwriting any existing entries. The EwsAllowedAppIDs command writes the complete list, so preserve the current value.
$current = (Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy).EwsAllowedAppIDs
$updated = @($current -split "," | ForEach-Object { $_.Trim() } | Where-Object { $_ }; $appId) | Select-Object -Unique
Set-OrganizationConfig -EwsAllowedAppIDs ($updated -join ",")
  • Verify that the App ID was written.
Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Format-List EwsAllowedAppIDs
  • Wait for the change to propagate. Because of the Exchange Online configuration caching, this can take up to 24 hours.
  • Set EWSEnabled to True
Set-OrganizationConfig -EWSEnabled $true
  • Wait for under 1 hour (but can be up to 4 hours), for the change to become effective.
  • Download Test-EWSAppAccess.ps1 and run Test-EWSAppAccess.ps1 with application authentication. The Mailbox parameter is required when using application permissions.
.\Test-EWSAppAccess.ps1 -AppId $appId -TenantId $tenantId -Mailbox $mailbox -SecretKey $secretKey
  • A successful test should report that the application accessed the mailbox.
Application <appid> successfully accessed mailbox <mailbox></mailbox></appid>
  • Confirm that $LASTEXITCODE is 0 and save the output with your change record.

Test 2: Remove the app and confirm access is blocked

  • Remove only the test App ID, preserving every other entry.
$current = (Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy).EwsAllowedAppIDs
$updated = $current -split "," | ForEach-Object { $_.Trim() } | Where-Object { $_ -and $_ -ne $appId }
Set-OrganizationConfig -EwsAllowedAppIDs ($updated -join ",")
  • Confirm that the App ID is no longer present.
Get-OrganizationConfig -RetrieveEwsOperationAccessPolicy | Format-List EwsAllowedAppIDs
  • Wait at least 24 hours before retesting. An immediate success can simply mean that an Exchange Online server still has the previous configuration cached.
  • Run the same Test-EWSAppAccess.ps1 command again.
  • After propagation, the expected result is a failure.
Application <appid> failed to access mailbox <mailbox></mailbox></appid>

Confirm that the process returns exit code 1. If the first test failed too, troubleshoot authentication, permissions, consent, mailbox access, and script dependencies before concluding that the allow list caused the failure.

  • Restore the test App ID to the full list, verify the configuration, wait for propagation, and repeat the successful-access test.

Do not leave a production tenant with an unintentionally empty or incomplete App ID allow list.

The fastest way to re-enable EWS after App ID blocking

Let’s say you are testing this process in a tenant and after setting both EWSEnabled = True and populating EWSAllowedAppIDs you do not see results that you expected and need the quickest way to undo your changes and re-enable the use of EWS in your tenant.

  • Changes to EWSAllowedAppIDs take ~24 hours to fully apply to your tenant.
  • Changes to EWSEnabled take about 1 hour.
  • EWSAllowedAppIDs (Allow List) is ignored if EWSEnabled is set to Null.

Therefore, the quickest way to re-enable EWS in an unrestricted way is to set EWSEnabled back to Null. One hour later, EWS will be unrestricted:

Set-OrganizationConfig -EWSEnabled $null

EWSEditor is another option

EWSEditor is also available for administrators and developers who prefer an interactive EWS API explorer. It can be useful for making a real EWS call against a test mailbox while using the same application identity you are validating.

You still need a correctly configured OAuth application, EWS permissions and consent, a controlled test mailbox, a recorded baseline, and enough time for EWSAllowedAppIDs changes to propagate.

Common pitfalls to avoid

  • Running the negative test immediately after removing the App ID.
  • Replacing the entire list instead of preserving existing App IDs.
  • Testing with an empty Inbox when the test script reads the first Inbox item.
  • Treating an OAuth, permission, consent, or credential failure as proof that EWSAllowedAppIDs blocked the request.
  • Confusing the user-agent-based EWSAllowList or EWSBlockList with the new App-ID-based EWSAllowedAppIDs control.
  • Adding an App ID for a workload that uses REST but does not call EWS.

Customer guidance in one paragraph

If an application calls EWS and requires temporary access during the retirement transition, validate its application ID with EWSAllowedAppIDs in a test tenant. If a tenant already uses EwsApplicationAccessPolicy, assess its EWSAllowList or EWSBlockList separately because those user-agent settings can also affect REST. The similar names do not make the controls interchangeable.

This distinction matters because we are already seeing customers assume that any setting beginning with “EWS” is part of the EWS retirement exception process. It is not. Making that mistake can create unnecessary configuration changes or interrupt REST workloads that were never using EWS.

The simple rule: use EWSAllowedAppIDs for the new EWS application-ID gate; use EWSAllowList or EWSBlockList only for the older user-agent policy. Test each layer independently.

And lastly: Set up your EWSAllowedAppIDs parameter while EWSEnabled is still Null, then wait 24h before changing EWSEnabled to True.

Sources and further reading

David Barrett
(All-round good guy and Exchange development expert)

Updated Oct 14, 2026
Version 5.0

37 Comments

  • Pankaj9873's avatar
    Pankaj9873
    Brass Contributor

    Has anyone enabled the EWSAppIDs and EWSEnable = True and face any issue or not?

    Please share experience. 

  • Hi Nino_Bilic​ Greg Taylor - EXCHANGE​ 

    I tested Enabling EWS to True this gets effective exactly after 2 hours not 1 hour and i have tested in two different test tenants' same results.

    Set-OrganizationConfig -EWSEnabled $true

    • Wait for 1 hour, for the change to become effective.

  • NigelR's avatar
    NigelR
    Copper Contributor

    I'm having a problem using the script to test delegated access (it works fine for app level permissions).

    I found it needs a redirect URL on the command line to get me to the login page but when I copy the redirect URL from the browser I get the error "Failed to obtain OAuth token":

    PS C:\Users .\Test-EWSAppAccess.ps1 -tenantid "70....75" -appid "226...9d" -RedirectUri http://localhost
    Please complete log-in via the web browser, and then copy the redirect URL (including auth code) to the clipboard to continue
    Auth code acquired, attempting to obtain access token
    Failed to obtain OAuth token
    At C:\Users\Test-EWSAppAccess.ps1:197 char:5
    +     throw "Failed to obtain OAuth token"
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (Failed to obtain OAuth token:String) [], RuntimeException
        + FullyQualifiedErrorId : Failed to obtain OAuth token

     

  • Mehtabkhan's avatar
    Mehtabkhan
    Copper Contributor

    In My case the output 
    EwsEnabled : 
    EwsApplicationAccessPolicy :
    EwsAllowList :
    EwsBlockList :
    however when pulled the EWS usage i can see some applications are still listed there , may be it is building by default.
    can have what would be impact after EWS reitrment 

    • Greg Taylor - EXCHANGE's avatar
      Greg Taylor - EXCHANGE
      Icon for Microsoft rankMicrosoft

      Well, EWSEnabled is Null - so we're going to turn that to False sometime after Oct if you don't change it. Blocking all EWS. 

      So if you want to keep using EWS for a bit longer, set EWSEnabled to True, and configure the AppID allow list with the apps in your usage report. Do not touch EwsApplicationAccessPolicy, EwsAllowList or EwsBlockList would be my suggestion at this stage. 

  • SharathMM's avatar
    SharathMM
    Copper Contributor

    Hi Nino_Bilic​ Greg Taylor - EXCHANGE​

    I have done all the changes as suggested (populated the EwsAllowedAppIDs with the test appID, waited for 24hrs and EWSEnabled is set to TRUE and waited for 1 hour) and I tried to run the https://github.com/David-Barrett-MS/PowerShell-EWS-Scripts/blob/master/Legacy/Test-EWSAppAccess.ps1 script. But, I dont see any difference when the EWSEnabled is set to TRUE or if it is null. I also dont see any difference when the EwsAllowedAppIDs is populated with the test app and when it is removed from the EwsAllowedAppIDs list. Everytime I test it, I am getting the "SUCCESS" message and the $LASTEXITCODE is 0.

    Should we wait for the October 1st deadline or am I missing something ? 

    • Melito9's avatar
      Melito9
      Copper Contributor

      When you removed your test app from the allowed appID, there should be other appID entries left EwsAllowedAppIDs for it to enforce. If not, your test appID will still work. 

       

      I did my testing using  MS test connectivity and it worked for me as expected >https://testconnectivity.microsoft.com/

    • True with the AppID in the list and Null are going to produce the same result. Even after Oct 1st. True + AppID = allowed. Null means all EWS is allowed. 

      If you are only using 1 app, then there's your issue - True with an empty list, means all EWS is allowed. Check this post again: Introducing EWSAllowedAppIDs: Preparing for the Final Phase of EWS Retirement | Microsoft Community Hub

      Set up a list with 2 app IDs, then remove your test app, and see what happens. 

  • Hi Nino_Bilic​ 
    I have few questions regarding this

    August vs September: Microsoft mentions configuring EWSAllowedAppIds and EWSEnabled=True by the end of August as optional. Can this be completed during September, provided it is completed before October enforcement? Is there any impact if no action is taken by the end of August? Exchange Online EWS, Your Time is Almost Up | Microsoft Community Hub

    Allow List behaviour: If EWSEnabled=True and the Allow List is empty, does EWS remain available to all applications until enforcement? If selected applications are added to the Allow List, will all other applications not included be blocked?

    Propagation: Microsoft mentions Allow List changes can take up to 24 hours. Should we wait the full 24 hours before validating the result?

    Testing: What is Microsoft's recommended approach for safely testing EWSAllowedAppIds before applying a selective Allow List in production?

    Application selection: Should the Allow List include all applications identified through EWS usage reporting, or only applications confirmed to still require EWS?

    • Nino_Bilic's avatar
      Nino_Bilic
      Icon for Microsoft rankMicrosoft
      • Yes you can do those things in September; we wanted to set a date for folks to get it done before enforcements start in October but there is nothing magical about August as far as this goes.
      • If EWSEnabled = True and AppID Allow List is empty, then all EWS apps will be allowed, yes. If AppID allow list is populated then only applications on the list will be allowed (plus cross-tenant free/busy lookups). Other apps (not in the list) woiuld be blocked.
      • Yes you should wait for full 24 hours. Yes, it COULD happen faster for you. But if you want this to be predictable, 24 hours.
      • Unclear what you mean about question on how to test EWSAllowedAppIDs; this article is about how to test this... right?
      • Well... if you see applications in EWS usage reporting, that confirms EWS use, does it not? :) I do not fully understand this question. Bottom line is - unless it is on the AppID Allow List and the Allow List exists, it will be blocked.
      • Greg Taylor - EXCHANGE's avatar
        Greg Taylor - EXCHANGE
        Icon for Microsoft rankMicrosoft

        One thing on this : "If EWSEnabled = True and AppID Allow List is empty, then all EWS apps will be allowed, yes. " 

        This is only true until Oct 1st. Oct 1st is a hard deadline whereby if the AppID Allow List is empty or missing - EWS will be blocked. Configuring the Allow List is important. 

  • Chad_C's avatar
    Chad_C
    Brass Contributor

    Do I need to whitelist the Microsoft Power Query and Microsoft Office well-known apps that are still showing EWS activity or will Microsoft know enough to keep things running until they support Graph API?

    • Nino_Bilic's avatar
      Nino_Bilic
      Icon for Microsoft rankMicrosoft

      You should allow list whatever is important for your business, even though we will also add things to your allow list based on your usage (as mentioned before). Now here is why you should do this, even if we fixed all of this tomorrow:

      Many of those applications - even if fixed tomorrow - require updates to client machines. So, while in a service app, the change rolls out when it's made, changes to client apps on end user machines might roll at a different schedule. So to make sure - you should allow list what matters to your business, to give yourself the best chance of having no disruptions because that disruption could also come from Office client machines not taking updates as quickly as we release Office builds with fixes (as an example).

  • Pankaj9873's avatar
    Pankaj9873
    Brass Contributor

    Ok, Thasnk for the details explanation. if I understood the order, please correct me if I am wrong.

    we already have EWSEnabled set null.

    1. We first need to AllowAPPIDs, then wait for 24 hours to get it replicated,?
    2. then, after 24 hours enabled EWSEnabled =True?
    3. or we can do both steps at same time?
    4. and, if it does not work as expected and we set EWSEnabled=Null so do we need to remove AppID we added or its not required. 
    5. Microsoft will ignore means, we do not need to set EWSEnabled =True again?
    • Nino_Bilic's avatar
      Nino_Bilic
      Icon for Microsoft rankMicrosoft

      No, you should not change AppID allow list and EWSEnabled at the same time. Again, I suggested exact steps with a reason; you want your results to be predictable and control exactly when settings will take place. Allow 24 hours for AppID allow list setting to sit. Then choose the time when you want to flip EWSEnabled to True and know that you will see results in max 1 hour. If you changed both concurrently then you are not quite sure when both things will take effect and you might find yourself in a situation you did not expect.

      If things are not working, you need to figure out what was wrong and fix it and test again (if you need to put any apps on the allow list). And yes, before October comes around your EWSEnables should be set to True, if you need EWS to keep working, as starting October, we will start to flip any EWSEnabled from Null to False. So unless your EWS Enabled is set to True, we might disable your EWS then.

      (I'll make a few tweaks in my original reply above to clarify)

      • Pankaj9873's avatar
        Pankaj9873
        Brass Contributor

        Nino_Bilic​ While we first populate the AppID and set the EWSEnabled = True after 24 hours, I hope there will be no impact to the application during the replication or after the replication until I set the EWSEnabled to True?

        I understand when everything set if it does not work then I need to troubleshoot while checking Entra sign-in logs. or If there is any other steps for troubleshooting. 

        Just wanted to know\check that application will only impact or would not work when EWSEnabled set to True along with AppIDs and not during replication. 

  • Pankaj9873's avatar
    Pankaj9873
    Brass Contributor

    Nino_Bilic​ What if we do not have test tenant to test this scenario?

    We simply use Set-Organizatoinconfig -EWSTrue = True and Set-ewsallowedappid -Appid (Appname) to allow. 

    I see EWSAllowList and EWSBlocklist is null in my org and I believe this has nothing to do with this EWS excercise for now.

    • Nino_Bilic's avatar
      Nino_Bilic
      Icon for Microsoft rankMicrosoft

      You are correct that EWSAllowList and EWSBlocklist are really not related to the overall EWS deprecation (this is really a feature to filter EWS requests based on user agents - there is nothing new here).

      The safest way to test AppID allow list is to:

      1. Have EWSEnabled = Null (this allows all EWS and ignores the AppID allow list)
      2. Set your AppID allow list using EWSAllowedAppIDs; verify it was set as you intended
      3. Let that sit for 24 hours (this takes 24 hours)
      4. Change EWSEnabled = True (this will "enable" your AppID allow list to take effect)
      5. Let that sit for 1 hour (this takes up to an hour to take effect)
      6. Check if everything works as expected

      If yes = good. If no = set EWSEnabled = Null. This change takes max 1 hour and will then start ignoring your AppID allow list. Then, you can figure out what is going on with your AppID allow list, modify it or what not.

      Just remember:

      • AppID allow list (EWSAllowedAppIDs) = 24 hours for changes to really take
      • EWSEnabled = 1 hour for changes to take
      • Before October comes, if you need EWS to keep working, your EWSEnabled setting should be set to True. If it is set to Null, starting October, we will be changing Null to False. By having it set to True, you are guaranteeing that we do not turn your EWS off.