Convert User Mailboxes to Shared Mailboxes in Office 365

Updated on 27 November 2014

Below are a few commands to covert user mailboxes to shared mailboxes in Office 365 (O365) Exchange Online.

If you have not already installed the required tools to connect to Office 365, please take the time to do so now before proceeding.

NOTE: The standard version of PowerShell that comes with the Windows OS will not be sufficient alone to run the O365 commands.

 

Connect to Office 365

Connect to Office 365 from an elevated PowerShell console…

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
$CRED = Get-Credential
$SESSION = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $CRED -Authentication Basic -AllowRedirection
Import-PSSession $SESSION
Connect-MsolService -Credential $CRED

 

Convert to Shared Mailbox

Convert mailbox and set size quota.  NOTE: Shared and resource mailbox sizes increased from 5GB to 10GB in Q4 2013; and increased from 10GB to 50GB in Q4 2014.

Get-Mailbox -identity engineering@domainname.com | set-mailbox -type “Shared”
Set-Mailbox engineering@domainname.com -ProhibitSendReceiveQuota 50GB -ProhibitSendQuota 49.75GB -IssueWarningQuota 49.5GB

 

Assign Permissions

Assign permissions to specific group to access shared mailbox…

Add-MailboxPermission engineering@domainname.com -User "Engineering Group" -AccessRights FullAccess

 

Remove Office 365 License

Shared and Resource mailboxes do not require a license in Office 365. To remove an Office 365 license from shared mailbox to prevent from being charged for usage, perform the following commands…

Connect-MsolService
$MSOLSKU = (Get-MSOLUser -UserPrincipalName engineering@domainname.com).Licenses[0].AccountSkuId
Set-MsolUserLicense -UserPrincipalName engineering@domainname.com -RemoveLicenses $MSOLSKU

Have fun.

Reference(s):

Originally published on 14 Feb 2014 at http://oddytee.blogspot.com/2014/02/convert-user-mailboxes-to-shared.html

Advertisements

14 thoughts on “Convert User Mailboxes to Shared Mailboxes in Office 365

  1. Hey,

    Incase anyone else comes across this the Powershell Scripts no longer works to remove the Mailbox Licence but you can still remove the Office 365 licence as you would normally from the Active Users sections of the Office 365 Admin Centre. Before doing that though you will need to change the Shared Mailbox quota to a max of 5GB Using the script below:

    Set-Mailbox -Identity “username@domainname.com” -ProhibitSendReceiveQuota 5GB -ProhibitSendQuota 4.75GB -IssueWarningQuota 4.50GB

    Obviously if the MailBox is over the 5GB it will need to be shrunk befor actioning this as when the licence is removed the Shared Mailbox is deleted.

    Many thanks

    Nathan

    • Help me to understand which commands no longer work. I just tested without issue.

      Agreed that if we are converting a large mailbox to a shared one, there will need to be some maintenance. However, the limited for shared mailboxes increased from 5GB to 10GB in Q4 of 2013 as noted in the article.

      Let me know if something I wrote is unclear and I will do my best to correct it.

      • Im pretty sure he dont have the module:Microsoft Azure Active Directory Module for powershell install and started. The you get error in powershell.

      • I updated the post to include clarification on the perquisites needed before you can connect to O365 and convert a user mailbox to a shared mailbox.

        My apologies for any confusion.

  2. Thank you very much for this post, it is very helpful.

    I had just one question. After running this I now have a shared mailbox called “engineering@domainname.com” and also a user, with no licence assigned, with the same address. As the user does not have an exchange mailbox, I assume it has moved the mailbox over to the shared mailbox and the user can be safely deleted?

    • With Exchange on premise, shared and resource mailboxes are tied to user accounts in Active Directory (AD). They are disabled users nevertheless they are users with associated mailboxes. If we delete the disabled user account in AD, the associated shared/resource mailbox is deleted as well.

      The same rules hold true for Office 365. If we delete a user that is associated with a mailbox we converted to a shared mailbox, that mailbox gets deleted.

      We won’t see the result of the user deletion immediately, but we will within 5-10 minutes of the action. In the Shared tab of the Recipients section in EAC, we may see the shared mailbox but there will be a message “The items you’re trying to open couldn’t be found” at the top of the mailbox info window at the right side of the screen. Also, when we open the shared mailbox to edit it, a similar error will display. Eventually, the shared mailbox will no longer be displayed.

      I really like to adhere to the “teach to fish” approach. The information above is all well and good, but I would rather you test it out for yourself. Create a test mailbox, convert it, delete the user and then see what happens.

  3. Good article thanks Todd. We had a environment where there is no Exchange Server in AD i.e. we migrated from Domino to O365. Our AD users are synched to O365 using DirSync. Users are managed in AD using AD attributes e.g. targetaddress, proxyaddress.
    When users leaves the company the AD account either gets deleted or is moved out of the OU that is synched to O365. Now this has the effect of deleting the user account and mailbox in O365.
    To keep the mailbox and convert it to shared mailbox in O365 I did the following steps:

    Step1 : Convert O365 mailbox to shared:
    – Convert mailbox to shared mailbox
    Get-Mailbox -identity test@domain.com | set-mailbox -type “Shared”

    Step2: Delete/Move AD user account:
    – Deleted/moved user in AD ( When Dirsync triggered this caused the user and mailbox to get deleted in O365, you can trigger Dirsync manually to speed things up)

    Step3: Restore User account in O365
    – Restored User in O365 Portal (This caused the user to get restored as O365 “in cloud” user and the mailbox automatically reattached to the restored account, the mailbox will take a minute or two before it appears in “Shared” mailboxes in O365. So no longer an association with the AD user account and O365 mailbox i.e. it is now attached to the restored “in cloud” account)

    To restore user go to Office 365 portal “Users” > “Deleted Users”

    Step4: Assign access permissions to mailbox

    – Assigned access permissions to whoever requires access to mailbox
    Add-MailboxPermission test@domain.com -User “user@domainonline.onmicrosoft.com” -AccessRights FullAccess

    Step5: Remove Mailbox license
    – Remove license from the mailbox
    $MSOLSKU = (Get-MSOLUser -UserPrincipalName test@domain.com).Licenses[0].AccountSkuId
    Set-MsolUserLicense -UserPrincipalName test@domain.com -RemoveLicenses $MSOLSKU

    • Thank you for sharing.

      Obviously, MS has a new method via the O365 EAC to convert to a shared mailbox but I do recommend this to all my customers who still need access to mailboxes for terminated users (provided the mailbox is <50GB). Additionally, I recommend that customers could place a hold on mailboxes of terminated users. This accomplishes much of the same.

      Thanks again.

    • I suppose that since the Shared Mailbox size limit was increased to 50GB in Q4 2014, it would be a judgment call based on individual circumstances. As I understand it, when a Shared Mailbox exceeds the limit size, a license is required for that mailbox at that point. And, I would suppose if there is no license attached to a Shared Mailbox that exceeds the limit, one would be out of license compliance with Microsoft and would therefore be subject to limited accessibility or deletion after the 30 day timeframe elapses.

      Refer to this forum post … http://community.office365.com/en-us/f/158/t/55376.aspx; “when the grace time expired, your shared mailboxes will not be accessible

      And this post … http://www.msdigest.net/2013/03/the-limits-of-shared-mailboxes-in-office-365/; “There are however a limit to using Shared Mailbox, if you want to stay within the free license. Not many are aware of this, but a Shared Mailbox cannot grow larger than [50GB], if it exceeds the [50GB] limits it needs an license!

      • That’s what I thought. However, when I convert a mailbox to shared, wait for a day, then remove the license, the mailbox gets deleted completely. I have checked and it is well under the 50GB limit. Any ideas?

        Thanks

      • Deleted from Recipients>Mailboxes in the Office 365 Exchange Admin Center (EAC) or from Users>Active Users in the Office 365 Admin Center? You’ve confirmed it’s not in Recipients>Shared in the EAC?

      • Gone from Recipients>Shared in the EAC. We have to reassign a license so 365 gives the user a mailbox again, which will appear back in Recipients>Mailboxes in the EAC.

        Thanks

      • I really don’t know what to suggest then other than contacting the O365 support team.

        I just migrated one of my user mailboxes from on premise, converted it to a shared mailbox in O365 and removed the license without issue.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s