Share via


SharePoint Online: Creating site mailbox

The following article deals with setting up, configuring and troubleshooting of SharePoint Online site mailboxes. It refers to on-premises Exchange environment only for comparison and may not describe its full capabilities.

Site Mailbox

A site mailbox can be used from a SharePoint team site to store and organize team email. It can also be used from Outlook 2013 for team email, and as a way to quickly store attachments and retrieve documents from the team site.

https://support.office.com/client/Add-a-site-mailbox-cccaa235-c611-48e3-9653-0b9e161840e7

You can add one site mailbox per site.

How to change the name?

Right after you have created a site mailbox with default settings, you end up with ugly SMO-SiteName@DomainName.onmicrosoft.com.

The mailbox will not be found in Exchange Admin Center nor through get-mailbox cmdlet.  You will see them in Office 365>Active Users or through get-msoluser.

You can change the UserPrincipalName of the site mailbox using:

Set-msoluserPrincipalname –UserPrincipalname SMO-SiteName@DomainName.onmicrosoft.com –NewUserPrincipalName lovely@DomainILove.com

This, however, may not be useful if you are faced with several or several hundreds of site mailboxes. The thing to consider is a Provisioning Policy for all site mailboxes.

You can view the current settings by typing in Get-SiteMailboxProvisioningPolicy | fl

Let’s modify the AliasPrefix. It is the SMO- that appears by default in front of all your currently provisioned site mailboxes.

In order to do that you need to Enable-OrganizationCustomization. If it’s not enabled, you will receive an error:

There are certain limitations for the prefix that you have to follow:

- It cannot start with a number

- It cannot end with a dot

-It cannot have consecutive dots

- The value should be a combination of letters, numbers, and allowed special characters, e.g.   dot, comma, underscore and hyphen         “,” ” .” ” _” ”-“

If you prefer to create the mailbox without the prefix, just enter empty string  “”.

The settings will apply for mailboxes created both through Powershell and manually on the website through Site Contents>Add an app>Site mailbox.

New-SiteMailboxProvisioningPolicy is available in on-premises Exchange but not for the Online environment.

Size

Site mailbox size is 5 GB across all plans.

It is possible to raise this limit in an on-premises Exchange environment, where the 5GB is not a limit but a default setting. Site mailbox size is unchangeable in Sharepoint/Exchange Online. As we can read in set-sitemailboxprovisioningpolicy description, the ProhibitSendReceiveQuota, IssueWarningQuota, and MaxReceiveSize are available only in on-premises Exchange 2013.

**

How to create a site mailbox?

In order to add a mailbox to your site, you need to activate site mailbox feature from the site settings.

Manually

Go to your site>Click Gear icon>Site settings>Site features>Site Mailbox>Activate

Go to your site>Click Gear icon>Site Contents>Add an app>Site mailbox

 You can follow an article here for more details and picture instruction:

https://support.office.com/en-us/article/Prepare-for-using-site-mailboxes-in-Office-365-6381daa5-3d98-4629-972d-d19e1dc48c1b?ui=en-US&rs=en-US&ad=US

Scripting

There is no Sharepoint Online Powershell equivalent of on-premises Enable-SPFeature. That means we have to resort to CSOM, i.e. Client-Side Object Model, in order to enable the Site Mailbox feature:

You will need SharePoint SDK, Azure AD module and SharePoint Online Management Shell installed:

# adding the SDK

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"  

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"  

 

# creating the client context

$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($site)   
$ctx.Credentials= New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)

# loading the site

$rootWeb = $ctx.Web  
 
$ctx.Load($rootWeb) 
 
$ctx.ExecuteQuery() 

# creating the feature’s GUID. In order to enable the feature, we need to know its GUID. The list of GUIDs can be found here:

http://blogs.msdn.com/b/razi/archive/2013/10/28/listing-all-sharepoint-2013-features-including-name-title-scope-id-and-description.aspx

For Site Mailbox feature it is "502a2d54-6102-4757-aaa0-a90586106368" .

$feature="502a2d54-6102-4757-aaa0-a90586106368" 
$featureguid=new-object System.Guid $feature  

#enabling the feature

$rootWeb.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None) 
      $ctx.ExecuteQuery() 

Now that we have the feature enabled, we can move on to adding the site mailbox.

# we need to open a new session

$credy= New-Object System.Management.Automation.PSCredential($username,$password) 
import-module msonline 
connect-msolservice -credential $credy 
$sesja=new-pssession -configurationname microsoft.exchange -connectionuri https://ps.outlook.com/powershell/ -credential $credy -authentication basic -allowredirection 
import-pssession $sesja 

# creating the mailbox is already pretty straightforward

new-sitemailbox -displayName “Title” -SharePointUrl $rootWeb.Url 

Seems complicated? Certainly more than doing it manually!

The main use for scripting is when you do a lot of something: bulk-add users, bulk-create mailboxes or in our case: bulk-enable the feature and bulk-add site mailboxes. Below you will find a ready script for adding mailboxes to all sites on the whole tenant!

https://gallery.technet.microsoft.com/scriptcenter/Add-Mailboxes-to-all-f58e63ef

You can also try with one site or site collection:

https://gallery.technet.microsoft.com/scriptcenter/How-to-add-a-mailbox-to-861e63da

https://gallery.technet.microsoft.com/scriptcenter/Add-Mailbox-to-a-1b9a7f25

Happy SharePoint mailboxing!

Other languages

This site is available in other languages:

Wiki: Tworzenie skrzynek pocztowych witryny SharePoint Online (pl-PL)