Freigeben über


Automating Site Mailboxes in SharePoint 2013 and Exchange 2013

One of the completely new features to ship with SharePoint and Exchange 2013 is the new Site Mailboxes capability to give a unified view of both documents and emails in SharePoint and Outlook. For an overview of the feature, see the Product Group's posting here and for first time configuration information see here.

In this post, I'll be exploring how Site Mailbox provisioning can be automated in an on premises install of Exchange and SharePoint. At present, hybrid scenarios are not supported for Site Mailboxes - i.e. both SharePoint and Exchange should either be on premises or both in the Cloud.

I’ll be running these commands from a SharePoint server and so using remote PowerShell to connect to the Exchange server (called ukmcs15-ex in this example). The following code needs credentials with permission to allow site mailbox creation.

 $user = Get-Credential
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ukmcs15-ex/powershell -Credential $user
Import-PSSession $session
Add-PSSnapin Microsoft.SharePoint.Powershell

 

First, in my lab environment, I need to do some one off housekeeping to support OAuth over HTTP. Please note, this is not recommended for production environments and only used here to simplify the configuration without using SSL certificates:

 $s = Get-SPSecurityTokenServiceConfig
$s.AllowMetadataOverHttp = $true
$s.AllowOAuthOverHttp = $true
$s.Update()

 

Now, I’ll define the variables for my mailbox. This includes its team site URL, mailbox alias, mailbox display name and one mailbox owner.

 $url = https://fifteen/sites/AnotherSiteMailbox
$address = "anothersitemailbox"
$display = "Another Site Mailbox"
$owner = "UKMCS\alexdo"

 

Let’s do the SharePoint configuration first.

 $site = New-SPSite -Url $url -OwnerAlias $owner -Template "STS#0" -Name $display
$web = $site.OpenWeb()
$web.CreateDefaultAssociatedGroups($site.Owner.LoginName,$null,$null)
Enable-SPFeature "CollaborationMailbox" -Url $url

 

And now the Exchange side to create and link the site mailbox.

 $mailbox = New-SiteMailbox -SharePointUrl $url -Name $address -DisplayName $display
$mailbox | Set-Mailbox -Language "en-GB"
$mailbox | Set-MailboxRegionalConfiguration -TimeZone "GMT Standard Time"

 

You’ll see how I’ve deliberately set a mailbox owner and regional configuration to allow end users to open the Outlook Web Access view without additional prompts.

The finished result in Outlook:

 

Whilst this code sample is basic, I hope it provides a starting point to allow scripting of site mailbox creation to meet your requirements.

Alex O’Donnell
SharePoint Consultant
Microsoft Consulting Services UK

Comments

  • Anonymous
    December 06, 2012
    Hi Alex, Thanks for posting these steps. The only problem I came across was with last step: PS C:> $mailbox = New-SiteMailbox -SharePointUrl $url -Name $address -DisplayNa me $display -Owners $owner A parameter cannot be found that matches parameter name 'Owners'.

  • Anonymous
    December 12, 2012
    Alex, Thanks for the update. You're absolutely right, the Owners parameter has now been removed in the RTM version of Exchange 2013 - I'll update the blog. This means the automatic permissions synchronisation will inherit mailbox permissions from SharePoint site permissions. Hope this helps. Alex

  • Anonymous
    January 30, 2013
    Thanks for the nice easy workflow. After i follwed all steps and i am seeing below error when i try to open site mailbox in share point ? Any idea on this ? We are having trouble contacting SharePoint Server The server might be temporarily unavailable. Please check back on this page in a few minutes. If this problem persists, please contact your system administrator. Thakns, Kiran!

  • Anonymous
    January 30, 2013
    The comment has been removed

  • Anonymous
    January 30, 2013
    Hi, I am seeing sitemailbox is showing disabled as user under Active directory. Is this expected ? Could you please tell me if there any steps which i need to follow to access this site mailbox. Also is the site mailbox supported to access through OWA ? Thanks!

  • Anonymous
    January 30, 2013
    Hi, I am getting below error while accessing site mailbox. Your SharePoint Server configuration is not supported Your organization's SharePoint Server configuration is not supported. Please contact your system administrator for more information. Correlation ID: 67fdf99b-8f74-606f-37f8-69398ab2959e, Error Code 104 Thanks!

  • Anonymous
    February 01, 2013
    Kiran, Before attempting the automation above, I'd validate that manual provisioning works through SharePoint. The above error sounds like the OAuth trust isn't setup correctly so you may want to re-validate the configuration steps. Site mailbox user objects will show as disabled in Active Directory - this is expected. Whilst the web view of the site mailbox is rendered through OWA, it won't show alongside the user's mailbox in the normal way. Hope this helps. Best wishes, Alex

  • Anonymous
    March 16, 2013
    Alex, How is it different from Public folder in exchange if you create them so they are available in sharepoint 2010 site. Thanks, Sarah browse for cloud www.sqlservermanagementstudio.net

  • Anonymous
    March 16, 2013
    Sarah, This is the completely new SharePoint 2013 and Exchange 2013 functionality and very different from traditional Exchange Public Folders. Site Mailboxes are designed to give a view of both documents and emails from both SharePoint and Outlook. Public Folders are primarily Outlook based and don't offer native SharePoint site integration. Alex

  • Anonymous
    October 21, 2013
    If a document is attached to a message that is sent to a site mailbox, will SharePoint crawl the contents of that attached document?  

  • Anonymous
    October 22, 2013
    Jason - in this scenario, mail attachments will only be crawled by SharePoint once they are stored in a SharePoint document library. So dragging the attachment from an email in to a Site Mailbox's Documents folder would work.

  • Anonymous
    January 03, 2014
    How can we specify the domain that is used when Site Mailboxes are created in Office 365? For historical reasons, We have many active domains in 0365 and when a Site Mailbox is created one of the old domains is used, I need to set a different domain as the default, but I can't find any way to configure this. TIA Dean

  • Anonymous
    January 03, 2014
    Dean, Whilst this is configurable in an on premises scenario, I don't believe this can currently be configured in Office 365. As you may have seen, you have only limited control over the prefix as per technet.microsoft.com/.../jj710340(v=exchg.150).aspx. I'd recommend raising a support request to see if there are any other options available. Alex

  • Anonymous
    April 20, 2014
    The comment has been removed

  • Anonymous
    May 01, 2014
    Prasad, You shouldn't have any issues with sub-sites having a site mailbox. The error above is a little generic, you really need to track down that correlation ID in the ULS logs to find the root cause. It could be an intermittent configuration issue that wasn't present when you made the first mailbox. For example if you have multiple front ends and the EWS binaries aren't present on each server. Alex

  • Anonymous
    July 16, 2014
    The comment has been removed

  • Anonymous
    July 16, 2014
    Adrian, To be honest, I'd steer clear of this approach. You may notice that this scenario is explicitly blocked in Office 365 and you now can't add a site mailbox to a personal site. Whilst you may be able to hook one up with the Set-SiteMailbox cmdlet, I'd explore other options for Exchange / SharePoint integration on premises or look out for Unified Groups in Office 365 - blogs.office.com/.../the-garage-series-for-office-365-work-like-a-network-a-first-look-at-enterprise-social-updates-with-yammer. Alex

  • Anonymous
    December 10, 2014
    Can anyone help me here to come out from the issue, i have mentioned the error details below. When i tried to access the Site Mailbox in My SharePoint site it throws the "Correlation ID: 04a5d49c-4883-501d-4b1d-7fa9bc66c345, Error Code 104". Am having farm administrator access and also i have checked the corresponding Features which are in Active state. Kindly suggest for further process.....

  • Anonymous
    December 16, 2014
    Alex, Any updates about hybrid scenario? I'm planning to configure site mailbox using SharePoint onpremise and Exchange online. Thanks.

  • Anonymous
    November 05, 2015
    Does Site mailbox of sharepoint 2013 work with exchange server 2010? Regard, Stome007

  • Anonymous
    January 31, 2016
    Can I bump the Hybrid Scenario...I have a SharePoint 2013 on premise farm with a Hybrid Exchange (Office365) scenario. Is this possible if mailboxes are on prem?????