Others

Manage Microsoft 365 Shared Mailbox Permissions from Java

Natalie TaylorNatalie Taylor Nov 14, 2026 868 views

Question details

An organization needs to manage shared mailbox Full Access and Send As permissions from a Java application.

Manage Microsoft 365 Shared Mailbox Permissions from Java
Product
Microsoft 365 Exchange Online
Device & OS
not provided
Scenario
Administrators want to grant and remove shared mailbox permissions through an application instead of manually using the Microsoft 365 admin center or Remote PowerShell.
Observed behavior
The desired outcome is a secure, programmatic way to administer both permission types.
Before you start

Identify the shared mailbox and users by their Exchange Online identities, and confirm that the automation identity can be assigned the required Exchange permissions. Check your organization's policies for app authentication and administrative automation.

Solution 1Recommended

Use an Exchange Online PowerShell automation backend

Use this approach when a Java application needs to grant or remove shared mailbox permissions through a controlled service.

Have the Java application call an authenticated backend that runs approved Exchange Online PowerShell operations. The backend can use an approved automation service or a PowerShell runspace; do not expose arbitrary PowerShell execution to application users.

Full Access and Send As are separate permissions and must be managed with their respective cmdlets.

1
Set up the automation identity

Register or configure an automation identity for Exchange Online PowerShell. For app-only authentication, follow Microsoft's current guidance for certificate or managed identity authentication, Exchange.ManageAsApp where applicable, admin consent, and the required Exchange role assignments.

2
Connect the backend

In the automation service or PowerShell runspace, load the ExchangeOnlineManagement module and use Connect-ExchangeOnline with the authentication method configured for the service.

3
Manage Full Access

Use Add-MailboxPermission with -Identity, -User, -AccessRights FullAccess, and -InheritanceType All to grant access. Use Remove-MailboxPermission with the mailbox, user, and FullAccess right to remove an explicit grant.

4
Manage Send As

Use Add-RecipientPermission with -Identity, -Trustee, and -AccessRights SendAs to grant Send As. Use Remove-RecipientPermission with the same mailbox, trustee, and access right to remove it.

5
Connect and verify the Java workflow

Call the backend's approved grant or remove operation from Java, validating the mailbox, user, and requested action. Use Get-MailboxPermission and Get-RecipientPermission in the backend to verify the resulting permissions.

Secure the integration: Authorize each caller, restrict the operations and identities the service can modify, protect credentials, and log administrative changes. Permission changes may take time to propagate.
Free Microsoft Office alternative

Use WPS Office for everyday document work

WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Microsoft Office format support make it easier to move existing files, though it does not manage Exchange Online mailbox permissions.

Keep documents related to mailbox administration in an easy-to-use office suiteOpen and edit Microsoft Word, Excel, and PowerPoint formatsUse a familiar interface for a smoother transition from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can Java call the Exchange Online permission cmdlets directly?

A Java application can call a secured backend that runs the Exchange Online PowerShell cmdlets. Use an approved automation service or PowerShell runspace rather than allowing Java clients to submit arbitrary commands.

Does Full Access also grant Send As?

No. Manage Full Access with Add-MailboxPermission or Remove-MailboxPermission, and manage Send As separately with Add-RecipientPermission or Remove-RecipientPermission.

How can I check a user's current mailbox permissions?

After connecting with Connect-ExchangeOnline, use Get-MailboxPermission for Full Access entries and Get-RecipientPermission for Send As entries. Review whether an entry is explicit or inherited before attempting to remove it.

What permissions does the automation service need?

The service needs an authentication method supported by Exchange Online PowerShell and appropriate Exchange role assignments. For app-only access, follow Microsoft's current guidance on Exchange.ManageAsApp, admin consent, and the chosen certificate or managed identity setup.