Powershell script to create shared mailbox and E1/E3 User in hybrid

lalajee 1,811 Reputation points
2023-02-14T00:45:13.34+00:00

Hi,

I'm trying to write an powershell script to create shared mailbox and new user account with E1 or E3 lic

Shared Mailbox Requirement

  • Create new shared mailbox in office 365 - Need to check make sure shared mailbox doesn't existed
  • Create new security group - Need to make sure Security group doesn't existed before creating
  • Assign Full access/Send as permission for the security group above
New-RemoteMailbox -Shared -Name "SharedMailbox1" `
    -UserPrincipalName "SharedMailbox1@domian.com" -OnPremisesOrganizationalUnit "OU=Shared,OU=Company,DC=local" `
    -RemoteRoutingAddress "SharedMailbox1@domain.mail.onmicrosoft.com"

Microsoft Exchange Online
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,272 questions
0 comments No comments
{count} votes