Creating shared mailbox in exchange online Programmatically

Patel, Brijesh 1 Reputation point
2022-02-15T20:35:29.913+00:00

Hello All,

We have a requirement where we need to connect to EXO and create a shared mailbox from a server using Java code. Is something like this possible? if so, can someone please guide me to correct documentation? We currently have java code running PowerShell v2 where the script creates a shared mailbox on premise.

I see in the some documentation that we need to connect to Exchange-online via PowerShell, but not sure how authentication can be done programmatically.

Thanks!

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,484 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
540 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,507 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andy David - MVP 147.6K Reputation points MVP
    2022-02-15T21:02:03.103+00:00

    Are you syncing from on-prem to Exchange Online with AADConnect?
    If so, then what you really want to do is create a remote shared mailbox with your existing code on-prem and not directly in 365.

    For connecting to Exchange Online, use the App-based auth:

    https://learn.microsoft.com/en-us/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.