I have solved a one case where we wanted to connect (Use the Connect-Mailbox cmdlet to connect a disconnected mailbox to an Active Directory user object.) an archive mailbox to a linked mailbox in Exchange 2013.
Error from EMS:
[PS] C:\>Connect-Mailbox -Identity "Personal Archive - Jan Novak" -Archive -User JanNovak2 -Database "EXDAG1-DB03" WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object. Object reference not set to an instance of an object. + CategoryInfo : NotSpecified: (:) [Connect-Mailbox], NullReferenceException + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Management.MapiTasks.ConnectMailbox + PSComputerName : server1.contoso.com
Error from GUI:
The LegacyDN "/o=CONTOSO/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Jan Novak" of "cb67270a-ada2-472e-94cc-eb7140f3520f" is in use by the following user in Active Directory: "Pepa Novak (new)". The value for LegacyDN must be unique to each user.
Obviously, the LegacyDN attribute was not unique and defended to connect the mailbox.
[PS] C:\> # disconnected archive [PS] C:\>(Get-mailboxdatabase|Get-Mailboxstatistics|?{$_.DisconnectReason -ne $null -and $_.DisplayName -like "*Jan*"}).LegacyDN /o=CONTOSO /ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Jan Novak [PS] C:\># linked mailbox [PS] C:\>(Get-mailbox JanNovak2).LegacyDN /o=contoso/ou=exchange administrative group (fydibohf23spdlt)/cn=recipients/cn=Jan Novak
How to connect mailbox in case this case? According to Technet and Connect-Mailbox (Exchange 2013) there is available a switch:
Well, we have available the switch for similar scenario (i.e. AllowLagacyDNMismatch), but it is reserved only for MS use. I do not know why is it so (let me know if you a clue), but it worked for me without problem:
[PS] C:\> Connect-Mailbox -Identity "Personal Archive - Jan Novak" -Archive -User JanNovak2 -Database "EXDAG1-DB03" -AllowLegacyDNMismatch [PS] C:\> Test-ArchiveConnectivity jan.novak@contoso.com RunspaceId : 7df20326-4fc0-4ca3-877f-5273aea0d5b7 Identity : jan.novak@contoso.com PrimaryMRMConfiguration : PrimaryLastProcessedTime : ArchiveDomain : ArchiveDatabase : EXDAG1-DB03 ArchiveMRMConfiguration : ArchiveLastProcessedTime : ComplianceConfiguration : ElcV2 ItemMRMProperties : Result : Successfully logged on to the users Archive mailbox. Error : IsValid : True ObjectState : New