Photo by Trace Hudson on

Issue Description :

Microsoft released -shared parameter for Set-RemoteMailox in Exchange 2013 CU 21. This has helped a lot of organizations and reduced effort in converting mailboxes.

Many organizations used approach to convert former employee mailboxes to shared to avoid licensing but there is a catch if you migrated a mailbox from on premise to exchange then this command doesn’t work and will throw an error. It will tell you to move the mailbox back to on prem and convert, which is a tedious task.

You will get an error if you run below command for a migrated mailbox :

set-remotemailbox -identity <emailaddress> -type shared
[PS] C:\Windows\system32>Set-RemoteMailbox -Identity -Type:shared
Creating a new session for implicit remoting of "Set-RemoteMailbox" command...
WARNING: An unexpected error has occurred and a Watson dump is being generated: remoteMailbox.RemoteRecipientType must
include ProvisionMailbox
remoteMailbox.RemoteRecipientType must include ProvisionMailbox
    + CategoryInfo          : NotSpecified: (:) [Set-RemoteMailbox], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.Exchange.Management.RecipientTasks.SetRemoteMailbox
    + PSComputerName        :

Why use shared parameter ?

There is a workaround, which can be done for such migrated mailboxes, you will say, why don’t we use the same approach on all mailbox, which are not the migrated one’s as well.

  • That’s is not recommend because -shared parameter is designed for the purpose.
  • If Microsoft releases any new recipient type, it can be easily handled by shared parameter but our script may need re-work again.

Caution :

Make note of mailbox size of mailbox being converted to shared, if they exceed 50 GB then, need to assign an Exchange Online P2 license otherwise email to them will bounce but if you are just keepping them for historical email then, this doesn’t matter to you.


Validate RemoteRecipientType account :

Get-RemoteMailbox | Where-Object {$_.remoterecipienttype -eq "Migrated"}

Name                          RemoteRecipientType
----                          -------------------
SourabhLTF                    Migrated

Capture, few more additional Properties :

Get-ADUser SourabhLTF -Properties * | select enabled, displayname, msExchRemoteRecipientType, msExchRecipientTypeDetails

enabled                    : False
displayname                : SourabhLTF
msExchRemoteRecipientType  : 100
msExchRecipientTypeDetails : 34359738368

Make Note of msExchRemoteRecipientType and msExchRecipientTypeDetails, You can refer below URL to find out meaning of different numbers.

Now, Let’s make change as per your need :

User with no Archive
Set-ADUser -Identity ((Get-Recipient -Replace @{msExchRemoteRecipientType=100;msExchRecipientTypeDetails=34359738368}

User with Archive
Set-ADUser -Identity ((Get-Recipient -Replace @{msExchRemoteRecipientType=99;msExchRecipientTypeDetails=34359738368}

Once we run above command, you do not need to run below command, account would be converted to office 365 in next Azure AD Connect sync cycle.

set-remotemailbox -identity <emailaddress> -type shared

You can verify object type of the mailbox, It would be Migrated, SharedMailbox.

Get-RemoteMailbox | Where-Object {$_.remoterecipienttype -eq "Migrated"}

Name                          RemoteRecipientType
----                          -------------------
SourabhLTF                    Migrated, SharedMailbox

Thank you for reading, Please like / comment if I have been helpful.