/commands/exchange-online/convert-mailbox-to-shared
Convert a user mailbox to a shared mailbox: Set-Mailbox -Type Shared
The commands on this page have not been executed by our verification runner yet.updated
- tool
- Exchange Online PowerShell
- versions
- Exchange Online, ExchangeOnlineManagement 3.x
- os
- windows, linux, macos
To turn a user's mailbox into a shared mailbox (for example when an employee leaves), run in Exchange Online PowerShell:
Set-Mailbox -Identity anna@contoso.com -Type SharedAll mail, calendar items and inbox rules stay in the mailbox. The command needs the Recipient Management or Organization Management role group, and the mailbox must still be licensed when you convert it.
Check the result
Get-EXOMailbox -Identity anna@contoso.com -Properties RecipientTypeDetails |
Format-List DisplayName,RecipientTypeDetailsRecipientTypeDetails changes from UserMailbox to SharedMailbox. Valid values of -Type are Regular, Shared, Room, Equipment and, in the cloud only, Workspace and Desk.
After converting
- Give people access:
Add-MailboxPermission -AccessRights FullAccessandAdd-RecipientPermission -AccessRights SendAs(commands). - Remove the license if the mailbox is smaller than 50 GB (for example with Set-MgUserLicense
-RemoveLicenses). Do not delete the user account: it anchors the shared mailbox. - Block sign-in or reset the password. If you do neither, the original user name and password keep working on the shared mailbox.
Check the size before removing the license:
Get-EXOMailboxStatistics -Identity anna@contoso.com | Format-List DisplayName,TotalItemSizeWhen the mailbox still needs a license
| Need | License |
|---|---|
| Mailbox larger than 50 GB (up to 100 GB) | Exchange Online Plan 2 |
| Litigation Hold or In-Place Hold | Exchange Online Plan 2, or Plan 1 plus Exchange Online Archiving |
| Auto-expanding archive | Exchange Online Plan 1 plus Exchange Online Archiving |
Convert back
Set-Mailbox -Identity anna@contoso.com -Type RegularThen assign a license and reset the password so the person can sign in again.
Sources
Related pages
commands · exchange-onlineExchange Online: grant FullAccess, SendAs and SendOnBehalf permissions with PowerShellFullAccess uses Add-MailboxPermission, Send As uses Add-RecipientPermission, Send on Behalf uses Set-Mailbox -GrantSendOnBehalfTo. Add, check, remove each.commands · exchange-onlineSet-MailboxAutoReplyConfiguration: set an out-of-office reply for another mailboxSet an automatic reply with Set-MailboxAutoReplyConfiguration -AutoReplyState Enabled or Scheduled, internal and external messages and -ExternalAudience.commands · microsoft-graphSet-MgUserLicense: assign or remove Microsoft 365 licenses with Microsoft Graph PowerShellSet-MgUserLicense -UserId -AddLicenses @{SkuId=...} -RemoveLicenses @() assigns a license. Get SKU IDs from Get-MgSubscribedSku; set UsageLocation first.