This blog will give the solution and fix for Active Directory and Messaging administrators

WARNING: An unexpected error has occurred and a Watson dump is being generated: Connect-Mailbox

Day to day we have to face some challenges in exchange and learn new things about it. Let us learn about how to connect disconnected mailbox and error message and how to fix it.
we can use the exchange admin center (EAC) or the Shell to connect a disabled mailbox to an user account. Exchange retains the disabled mailbox in the mailbox database disabled state. 

But, Exchange attributes were removed from the corresponding user account, but the user accounts still retained available until we delete it. Also, the mailbox is retained until the deleted mailbox retention period expires, which is 30 days by default, and then it's permanently deleted (or purged) from the mailbox database and mailbox cannot be connected. 

"To check the retention period you can use Get-MailboxDatabase | FL *retention*"

we can connect and use or export the the disabled mailbox data until permanently deleted from the Exchange mailbox database, it can be done EAC or the powershell to reconnect it to the original or another Active Directory user account.

Connect the Mailbox via Powershell:

Connect-Mailbox -Identity "DisplayName or GUID" -Database "DatabaseName" -User "TargetUser" 

Connect the Mailbox via Exchange Admin Center (EAC):
  1. Open Exchange Admin Center (EAC) --> Recipients --> Mailboxes.
  2. Click More More Options (...), then click Connect a mailbox.
  3. A list of mailboxes will be displayed, like... disconnected mailboxes includes disabled mailboxes, deleted mailboxes, and soft-deleted mailboxes.
  4. Click the disabled mailbox that you want to reconnect, and then click Connect.
While doing this we will get some error like below, it happens because of LegacyDN, 
The error message you can get it from EAC...

The LegacyDN "LegaacyDN value" is in use by the following user in Active Directory: "username". The value for LegacyDN must be unique to each user.

Error message in Powershell:

[PS] C:\Windows\system32>Connect-Mailbox  -Identity <Mailbox ID> -User <UserMailbox> -Archive -Database  <Database name>

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        : Server name


To fix this, we can use -AllowLegacyDNMismatch switch allow to connect the mailbox

Connect-Mailbox -Identity "DisplayName or GUID" -Database "DatabaseName" -User "TargetUser"  -AllowLegacyDNMismatch



Share:

Related Posts:

No comments:

Post a Comment

Search This Blog

Recent Posts