Configure Exchange Online RBAC for Applications for an existing app-only connection#

If Revenue Grid already uses app-only access in your organization, you can use Exchange Online RBAC for Applications to control which Exchange Online mailboxes the Revenue Grid application can access.

You can use Exchange RBAC to manage mailbox access for both Microsoft Graph and EWS app-only connections.

Important

Microsoft is retiring EWS in Exchange Online. EWS starts being disabled in October 2026 and will be fully disabled in April 2027. If your organization uses an existing EWS app-only connection, use this article only to manage mailbox access during the transition to Microsoft Graph.

Why configure Exchange RBAC for an existing connection?#

Exchange Online RBAC for Applications provides more granular control over the Exchange Online mailboxes Revenue Grid can access. The reason to update your existing configuration depends on how mailbox access is currently controlled.

  • If Revenue Grid has organization-wide mailbox access

    If Exchange mailbox permissions are currently granted organization-wide through Microsoft Entra ID, you can move the corresponding mailbox authorization to Exchange RBAC and limit access to only the mailboxes Revenue Grid needs. After you configure and verify the Exchange RBAC assignments, revoke the corresponding organization-wide mailbox permissions from Microsoft Entra ID.

  • If you use Application Access Policies

    Microsoft introduced RBAC for Applications as the replacement for Application Access Policies and plans to announce their deprecation. For details, see Application Access Policies (legacy). Moving to Exchange RBAC also removes the 300-policy-per-organization limit that applies to Application Access Policies.

Before you begin#

Make sure that:

  • Revenue Grid already uses a Microsoft Graph or EWS app-only connection in the profile you want to update.

  • You have a Platform admin or Profile admin role in Revenue Grid.

  • You have a Microsoft 365 admin account that can grant tenant-wide admin consent.

  • The Exchange Online PowerShell module is installed.

  • Your administrator account is a member of the Organization Management role group in Exchange Online or is assigned the Exchange Administrator role in Microsoft Entra ID.

  • At least one user is provisioned to Revenue Grid and assigned to the profile so that you can verify mailbox access.

Update an existing app-only connection to use Exchange RBAC#

To update the connection:

  1. Review the existing mailbox permissions

  2. Configure and verify Exchange mailbox access through Exchange Online RBAC for Applications

  3. Remove the corresponding organization-wide Exchange mailbox permissions from Microsoft Entra ID

  4. If applicable, remove the existing Application Access Policy

  5. Verify mailbox access in Revenue Grid

Complete the steps in this order to maintain Revenue Grid mailbox access while you change the authorization configuration.

Step 1: Review the existing mailbox permissions#

Before configuring Exchange RBAC, identify how the Revenue Grid enterprise application currently receives Exchange mailbox access.

  1. Sign in to the Microsoft Entra admin center.

  2. Go to Enterprise applications > All applications.

  3. Open the enterprise application used by your connection:

    • For Microsoft Graph app-only connectivity, open Revenue Inbox.

    • For EWS app-only connectivity, open Revenue Inbox EwsAppOnly.

  4. Go to Permissions and review the application permissions that have admin consent.

    ../../../../_images/app-only-permissions-entra-id.png

For a Microsoft Graph app-only connection, identify any Exchange mailbox permissions that you plan to authorize through Exchange RBAC. To determine which permissions can be replaced with Exchange RBAC assignments, see How Revenue Grid uses Microsoft Graph to connect to Microsoft 365 | Application permissions.

For an existing EWS app-only connection, check whether the application has the full_access_as_app application permission. This permission grants EWS mailbox access through Microsoft Entra ID. You can replace this authorization with the Application EWS.AccessAsApp Exchange RBAC role.

Important

Don’t revoke the existing mailbox permissions yet. They continue to provide mailbox access while you configure and verify Exchange RBAC.

Permissions that aren’t Exchange mailbox permissions and don’t have an equivalent Exchange RBAC application role continue to be authorized through Microsoft Entra ID.

Step 2: Configure Exchange mailbox permissions#

Exchange Online RBAC for Applications grants Revenue Grid the required Exchange mailbox permissions. You can grant these permissions organization-wide or scope them to specific mailboxes.

Get the Revenue Grid application IDs#

Get the identifiers of the Revenue Grid service principal in your Microsoft 365 tenant.

  1. Open the Microsoft Entra admin center.

  2. Go to Enterprise applications > All applications.

  3. Open the enterprise application used by the app-only connection:

    • For Microsoft Graph app-only connectivity, open Revenue Inbox.

    • For EWS app-only connectivity, open Revenue Inbox EwsAppOnly.

  4. On the Overview page, copy the Application ID and Object ID.

    ../../../../_images/application-id-and-object-id.png

    Important

    Use the Application ID and Object ID from Enterprise applications, not App registrations. The Object IDs displayed in these areas are different. Exchange Online requires the service principal Object ID from Enterprise applications.

The examples in this article use the following example values:

Application ID: 336be6bf-83eb-47ad-93ef-123456789abc
Object ID:      b70ff4ea-5243-4441-b286-abcdef123456

Replace these values with the IDs of the Revenue Grid enterprise application in your tenant.

Connect to Exchange Online#

Open PowerShell and connect to Exchange Online:

Connect-ExchangeOnline

For instructions, see Connect to Exchange Online PowerShell.

Register the Revenue Grid service principal in Exchange Online#

Create a pointer in Exchange Online to the Revenue Grid service principal in Microsoft Entra ID.

Run:

New-ServicePrincipal -AppId "<RevenueGridAppId>" -ObjectId "<ServicePrincipalObjectId>" -DisplayName "Revenue Grid"

Replace:

  • <RevenueGridAppId> with the Revenue Grid app’s Application ID.

  • <ServicePrincipalObjectId> with the Revenue Grid app’s Object ID.

Example:

New-ServicePrincipal -AppId "336be6bf-83eb-47ad-93ef-123456789abc" -ObjectId "b70ff4ea-5243-4441-b286-abcdef123456" -DisplayName "Revenue Grid"

If the service principal is already registered in Exchange Online, you don’t need to create it again.

Choose the mailbox access scope#

You can grant Revenue Grid access to all Exchange Online mailboxes in your organization or limit access to specific mailboxes.

If Revenue Grid should access all mailboxes, you don’t need to create a resource scope. Skip to Assign the required Exchange application roles and omit the resource scope when assigning each role.

To limit access to specific mailboxes, configure a resource scope using one of the following methods.

Use a group to define the mailbox scope#

If you have a Microsoft 365 group, mail-enabled security group, or distribution list containing the mailboxes Revenue Grid should access, you can use its membership to define the management scope.

Get the distinguished name of the group:

Get-Group "<GroupEmailAddress>" | Format-List DistinguishedName

Example:

Get-Group "[email protected]" | Format-List DistinguishedName

Then create a management scope using the distinguished name returned by the previous command:

New-ManagementScope -Name "<ScopeName>" -RecipientRestrictionFilter "MemberOfGroup -eq '<DistinguishedName>'"

Important

Only direct group membership is included in the scope. Nested group members aren’t included.

Supported group types include only Microsoft 365 groups, mail-enabled security groups, and distribution lists.

Use a recipient property to define the mailbox scope#

You can also define a management scope based on a supported recipient property:

New-ManagementScope -Name "<ScopeName>" -RecipientRestrictionFilter "<RecipientProperty> -eq '<Value>'"

For example, to include mailboxes whose Department property is Sales:

New-ManagementScope -Name "Revenue Grid mailboxes" -RecipientRestrictionFilter "Department -eq 'Sales'"

You can use other supported recipient properties, such as custom attributes, depending on how your organization identifies the mailboxes Revenue Grid should access.

Use a Microsoft Entra administrative unit#

If your organization uses Microsoft Entra administrative units to organize users, you can use an administrative unit as the resource scope instead of creating an Exchange management scope.

In this case, you don’t need to run New-ManagementScope. Use the -RecipientAdministrativeUnitScope parameter when assigning the Exchange application roles, as described in the next section.

Assign the required Exchange application roles#

Assign the Exchange application roles required for your connection.

For a Microsoft Graph app-only connection, assign the Exchange RBAC roles that correspond to the Microsoft Graph mailbox permissions Revenue Grid uses. To determine which permissions can be replaced with Exchange RBAC assignments, see How Revenue Grid uses Microsoft Graph to connect to Microsoft 365 | Application permissions.

For an EWS app-only connection, assign:

  • Application EWS.AccessAsApp

For organization-wide access#

Don’t specify a resource scope:

New-ManagementRoleAssignment -App "<ServicePrincipalObjectId>" -Role "<ApplicationRole>"

For example, to grant Application Mail.ReadWrite organization-wide:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application Mail.ReadWrite"

Repeat the command for each required role.

For an EWS app-only connection:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application EWS.AccessAsApp"

For an Exchange management scope#

Specify the management scope using -CustomResourceScope:

New-ManagementRoleAssignment -App "<ServicePrincipalObjectId>" -Role "<ApplicationRole>" -CustomResourceScope "<ScopeName>"

For example, to grant Application Mail.ReadWrite to mailboxes in the Revenue Grid mailboxes scope:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application Mail.ReadWrite" -CustomResourceScope "Revenue Grid mailboxes"

Repeat the command for each required role.

For an EWS app-only connection:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application EWS.AccessAsApp" -CustomResourceScope "Revenue Grid mailboxes"

For a Microsoft Entra administrative unit#

Specify the administrative unit using -RecipientAdministrativeUnitScope:

New-ManagementRoleAssignment -App "<ServicePrincipalObjectId>" -Role "<ApplicationRole>" -RecipientAdministrativeUnitScope "<AdministrativeUnitId>"

Replace <AdministrativeUnitId> with the ID of your Microsoft Entra administrative unit.

For example:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application Mail.ReadWrite" -RecipientAdministrativeUnitScope "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"

For an EWS app-only connection:

New-ManagementRoleAssignment -App "b70ff4ea-5243-4441-b286-abcdef123456" -Role "Application EWS.AccessAsApp" -RecipientAdministrativeUnitScope "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"

Verify the Exchange RBAC configuration#

Verify that the Revenue Grid service principal has the expected Exchange RBAC authorization.

Run:

Test-ServicePrincipalAuthorization -Identity "<ServicePrincipalObjectId>" -Resource "<MailboxEmailAddress>" | Format-Table

For example, suppose alex.wilson@contoso.com is included in the Revenue Grid mailboxes scope:

Test-ServicePrincipalAuthorization -Identity "b70ff4ea-5243-4441-b286-abcdef123456" -Resource "[email protected]" | Format-Table

The command returns the Exchange application role assignments for the service principal and indicates whether the specified mailbox is within the scope of each assignment.

For a Microsoft Graph connection, the output can look similar to this:

RoleName                         GrantedPermissions       AllowedResourceScope        ScopeType               InScope
--------                         ------------------       --------------------        ---------               -------
Application Mail.ReadWrite       Mail.ReadWrite           Revenue Grid mailboxes      CustomRecipientScope    True
Application Calendars.ReadWrite  Calendars.ReadWrite      Revenue Grid mailboxes      CustomRecipientScope    True

For an EWS connection:

RoleName                    GrantedPermissions  AllowedResourceScope       ScopeType              InScope
--------                    ------------------  --------------------       ---------              -------
Application EWS.AccessAsApp EWS.AccessAsApp     Revenue Grid mailboxes     CustomRecipientScope   True

Verify that InScope is True for each role required to access the mailbox.

If you configured access to specific mailboxes, you can also run the command for a mailbox that shouldn’t be accessible. For the scoped roles, InScope should be False.

Important

Test-ServicePrincipalAuthorization verifies Exchange RBAC assignments only. It doesn’t include application permissions granted through Microsoft Entra ID.

Changes to Exchange RBAC authorization can take from 30 minutes to 2 hours to propagate. Test-ServicePrincipalAuthorization bypasses the permission cache, so test results are immediate. Actual mailbox access can take longer to reflect the changes.

Step 3: Remove the corresponding Microsoft Entra ID mailbox permissions#

After you verify the Exchange RBAC configuration, remove the organization-wide Microsoft Entra ID permissions that provide the same Exchange mailbox access.

Microsoft Entra ID application permissions and Exchange Online RBAC assignments are independent and additive. If an organization-wide Microsoft Entra ID mailbox permission remains granted, a scoped Exchange RBAC assignment doesn’t restrict the access provided by that permission.

For example:

  • If you assigned Application Mail.ReadWrite through Exchange RBAC for Microsoft Graph app-only connectivity, revoke the corresponding organization-wide Mail.ReadWrite application permission from Microsoft Entra ID.

    Hint

    See How Revenue Grid uses Microsoft Graph to connect to Microsoft 365 | Application permissions for the mapping between Microsoft Graph application permissions and Exchange RBAC application roles.

  • If you assigned Application EWS.AccessAsApp through Exchange RBAC for EWS app-only connectivity, revoke the organization-wide full_access_as_app application permission from Microsoft Entra ID.

Important

Remove only the mailbox permissions that have corresponding Exchange RBAC assignments. Permissions that must be authorized through Microsoft Entra ID should remain granted.

To revoke an application permission:

To revoke permissions:

  1. In the Microsoft Entra admin center, go to Enterprise applications > All applications.

  2. Open the enterprise application used by your connection:

    • For Microsoft Graph app-only connectivity, open Revenue Inbox.

    • For EWS app-only connectivity, open Revenue Inbox EwsAppOnly.

  3. Select Permissions, then open the Admin consent tab.

    The Admin consent tab listing all of the granted permissions
  4. Review the permissions granted to Revenue Grid.

  5. For each mailbox permission you need to revoke, select the ellipsis (…), and then select Revoke permission.

    Option to revoke a specific permission under the three-dot menu

Step 4: Remove the Application Access Policy (optional)#

If your organization previously used an Application Access Policy to limit the Revenue Grid application’s mailbox access, remove the policy after Exchange RBAC is configured and the corresponding organization-wide Microsoft Entra ID mailbox permissions have been removed.

Review the existing policies:

Get-ApplicationAccessPolicy

Identify the policy that applies to Revenue Grid, and then remove it:

Remove-ApplicationAccessPolicy -Identity "<PolicyIdentity>"

Replace <PolicyIdentity> with the identity of the Application Access Policy you want to remove.

Step 5: Verify mailbox access in Revenue Grid#

After you complete the authorization changes, verify that Revenue Grid can access the expected mailboxes.

If you configured access to specific mailboxes, you can also run the command for a mailbox that Revenue Grid shouldn’t be able to access. For the scoped roles, InScope should be False.

To check access:

  1. Sign in to the Revenue Grid Platform.

  2. In the upper-right corner, select your profile icon, and then select Settings.

  3. Under Administration, go to Profiles.

  4. Open the profile that uses the app-only connection, and then go to the Connectivity tab.

    The profile Connectivity subtab
  5. In the Email configuration section, click Check users’ impersonated access.

    The Check users' impersonated access button in the Email configuration section
  6. Review the connection statuses for all users in the profile.

    The connection statuses for each user in a profile

For a scoped configuration, the user whose mailbox is included in the Exchange RBAC scope should be connected. The user whose mailbox is outside the scope shouldn’t be connected.

If both mailboxes are accessible, verify that you removed the corresponding organization-wide mailbox permission from Microsoft Entra ID.

If you recently changed an Exchange RBAC assignment and the result isn’t as expected, allow up to 2 hours for the permission cache to update, and then check access again.