How access is limited
There is not a single switch. Consent in Entra ID stays tenant-wide. ForCalendars.ReadWrite and MailboxSettings.ReadWrite you create a resource scope in Exchange Online: a mail-enabled group plus RBAC for Applications.
The app then gets calendar access only to mailboxes that are direct members of that group. Grants in Exchange are additive to Entra ID. While the tenant-wide Graph permissions remain in Entra ID, the scope has no effect.
Requirements
- Exchange Administrator role, or membership in Organization Management
- Exchange Online (cloud). The integration does not support on-premises mailboxes.
- A mail-enabled security group, Microsoft 365 group, or distribution list. Only direct members count, nested groups do not.
- The room and resource mailboxes that anny should sync are direct members of this group.
- The Application ID and Object ID of the enterprise application. Take the values from Enterprise applications, not from App registrations.
Limit access to specific mailboxes
1
Create the group
Create a mail-enabled group, for example
anny-scope. Add the room and resource mailboxes whose calendars anny may use.2
Connect to Exchange Online
Open PowerShell and connect to Exchange Online.
3
Create the service principal
Create the pointer to the enterprise application. The IDs come from Enterprise applications, not from App registrations.
4
Define the scope
Limit access to the members of the group. The filter needs the distinguished name.
5
Assign roles with the scope
Assign calendar and mailbox settings only for this scope.
6
Verify
Test whether a specific mailbox is in scope. The test bypasses the permission cache and only considers Exchange RBAC, not the grants in Entra ID.
7
Remove tenant-wide Entra grants
In Entra ID under Enterprise applications → your anny app → Permissions, remove the organization-wide application permissions
Calendars.ReadWrite and MailboxSettings.ReadWrite. Without this step access stays tenant-wide, because Entra ID and Exchange add the rights together.Limitations
- You only limit calendar access and mailbox settings. The account list in Microsoft calendar can still show more addresses, because it comes from the directory.
- Nested group members are out of scope.
- The personal Outlook integration is a different connection type. This procedure applies only to the organization-wide Microsoft 365 integration.
FAQ
Why do I still see many Microsoft accounts in anny?
Why do I still see many Microsoft accounts in anny?
The Microsoft calendar picker lists accounts from the directory. The Exchange scope limits calendar access, not this list. You can only sync a mailbox that is a direct group member. Other mailboxes fail.
The restriction has no effect, anny can still reach every calendar
The restriction has no effect, anny can still reach every calendar
The tenant-wide Graph permissions in Entra ID are then still active. Exchange RBAC adds to them and does not constrain access while Entra ID still grants the same access organization-wide. Remove
Calendars.ReadWrite and MailboxSettings.ReadWrite on the enterprise application.Do room mailboxes belong in the group?
Do room mailboxes belong in the group?
Yes. Every room or resource mailbox that anny should sync must be a direct member of the mail-enabled group.
Troubleshooting
A calendar is unreachable after the scope
A calendar is unreachable after the scope
The mailbox is often not a direct member of the group, or the permission cache is still active. Check membership and wait up to two hours, or test with
Test-ServicePrincipalAuthorization.The test says InScope, but Graph still allows everything
The test says InScope, but Graph still allows everything
Test-ServicePrincipalAuthorization ignores Entra grants. Remove the tenant-wide application permissions in Entra ID and wait for the cache to expire.