Setting up Shared mailboxes in Exchange online with Powershell

Often when you migrate users to Offiec365 you need to configure Shared Mailboxes. Bellow you find a small instruction on how to do this.

Connect to Exchange Online with Remote PowerShell

  1. Click Start
  2. Click Administrative Tools
  3. Right Click Windows PowerShell Modules and Run as administrator
  4. Set the Excution Policy on the local coputer
  5. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  6. Press “Y” for yes when/if prompted
  7. Specify remote credentials through a variable
  8. $cred=Get-Credential
  9. Enter your tenant admin account
  10. Enter password
  11. Set a session variable and connect to Exchange Online, enter command
  12. $s =New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic –AllowRedirection
  13. Import the session with the variable set in previous step.
  14. $importresults =Import-PSSession $s

Now you are connected to Exchange online with powershell.

Setup Shared Mailbox

The following section is copied from Microsoft. See this site for complete details. http://help.outlook.com/140/ee441202.aspx

After you create a shared mailbox, you have to assign permissions to all users who require access to the shared mailbox. Users can’t sign in to the shared mailbox. They have to sign in to their own mailbox and then open the shared mailbox to which they’ve been assigned permissions.

Here’s how to use PowerShell to create and configure a shared mailbox for the Corporate Printing Services department at Contoso Corporation.

Create a shared mailbox To create the shared mailbox for Corporate Printing Services, run one of the following commands:

Office 365

New-Mailbox -Name “info” -Alias corpprint -PrimarySmtp info@yourdomain.com -Shared

Set-Mailbox info -ProhibitSendReceiveQuota 5GB -ProhibitSendQuota 4.75GB -IssueWarningQuota 4.5GB

 

Create a security group for the users who need access to the shared mailbox In the Exchange Control Panel, create a security group for the staff who need access to the shared mailbox for Corporate Printing Services.

  1. Select My Organization Exchange> Users & Groups > Distribution Groups > New.
  2. Specify a display name, alias, and e-mail address. In this example, we’ll use Info, Companygroup, and Info@yourdomain.com.
  3. Select the Make this group a security group check box.
  4. In the Ownership section, click Add to add an owner, if necessary.
  5. In the Membership section, click Add.
  6. In the Select Members page, select the users you want to add. When you are finished, click OK.
  7. On the New Group page, click Save.

Note After you create a security group, the membership is closed. When membership is closed, only group owners can add members to the security group, or owners have to approve requests to join the group. Additionally, only group owners can remove members from the security group.

 

Assign the security group the FullAccess permission to access the shared mailbox

To enable members of the Printing Services Staff security group to open the shared mailbox, read e-mail, and use the calendar, run the following command:

Add-MailboxPermission “info” -User Companygroup -AccessRights FullAccess

 

Assign the security group the SendAs permission to the shared mailbox

To enable members of the Printing Services Staff security group to send e-mail from the shared mailbox, run the following command:

Add-RecipientPermission “Info” -Trustee Companygroup -AccessRights SendAs

Note It may take up to 60 minutes until users can access a new shared mailbox or until a new security group member can access a shared mailbox