Applies to: Microsoft Modern Exchange Connector (Graph) and Exchange Web Services (EWS) application connections
When using application permissions with either Microsoft Modern Exchange Connector (Graph) or EWS, permissions granted through Microsoft Entra apply to all mailboxes in the tenant by default. Exchange Online RBAC for Applications lets you grant supported Exchange mailbox permissions only for a defined mailbox scope.
Important: Microsoft is deprecating support for Application Access Policies. RBAC for Applications is the preferred and future-proof method for controlling mailbox access via application permissions.
Learn more in Microsoft’s announcement.
How Entra permissions and RBAC work together: Microsoft Entra application permissions and Exchange Online RBAC for Applications are separate, additive permission grants. RBAC does not restrict a matching permission that remains granted tenant-wide in Microsoft Entra. To limit a supported mailbox permission to the RBAC scope, assign the permission through Exchange Online RBAC and remove the matching tenant-wide application permission from Microsoft Entra after confirming the RBAC assignment works.
Prerequisites
To proceed, ensure you have the following:
A mail-enabled security group in Microsoft 365. Only users in this group will be accessible by the application.
Exchange Online PowerShell access with appropriate permissions.
The Application (client) ID and Object ID for the Riva Enterprise Application, found in Azure Active Directory > Enterprise Applications.
Step-by-Step: Restricting Mailbox Access with RBAC
1. Connect to Exchange Online via PowerShell
If you haven’t connected yet, follow Microsoft’s guide:
Connect to Exchange Online PowerShell
2. Identify the Mail-Enabled Security Group
You’ll need the Distinguished Name (DN) of the security group Riva users belong to.
Get-Group "YourGroupName" | Select-Object -Property DistinguishedNameOnly mail-enabled security groups are supported. Microsoft 365 groups, distribution groups, and security-only groups may not work properly with this method.
3. Create a Management Scope
Create a custom scope that limits access to the selected group:
New-ManagementScope -Name "RivaSyncScope" -RecipientRestrictionFilter {memberofGroup -eq "CN=GroupName,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=...,DC=COM"}Replace the value in
memberofGroupwith the DN obtained in Step 2.The scope limits the application to only mailboxes in this group.
4. Create a Service Principal for the Application
New-ServicePrincipal -AppId <ApplicationId> -ObjectId <ObjectId> -DisplayName "RBAC RivaSync"Replace <ApplicationId> and <ObjectId> with values from your Riva Azure Enterprise Application.
5. Assign the Application Role with EWS permission
Note: This step is only applicable to EWS, not Graph.
Related Resources
Related to