Quick Tip: Attaching a Mailbox to a Different Active Directory User

This post is not about taking a mailbox that has been inactive. Rather, this post is about taking an active mailbox that is already attached to an AD user and attach it to a different one.

Situation: Cross-forest migrations have a lot of moving parts. It requires two AD forests with accounts or trusts established, each with its own Exchange organization and proper mail flow with both a shared namespace and unique namespaces for routing mail and co-existing. To make it work, you need an AD account in the target forest that gets the ExchangeGUID of the mailbox stamped onto it as a MailUser. Sometimes there is a lack of control or an existing situation. In this case, AD replication was significantly impaired and after running the Prepare-MoveRequest.ps1 script, the AD user did not respond back that it had the ExchangeGUID attached, so it created a new account. The migration was successful, but to the wrong AD user. It was necessary to attach it to the proper AD User.

Steps:

  1. Save the mailbox to a variable in the Exchange Management Shell
  2. Determine if it is desirable to delete the AD user, or not
  3. Take the desired action, then connect the mailbox to the desired target AD user

$Mailbox = Get-Mailbox <Identity>
$Mailbox | Remove-Mailbox # Deletes the AD user
#$Mailbox | Disable-Mailbox # Disabled the AD user
Connect-Mailbox $Mailbox.ExchangeGuid `
    -Database $Mailbox.Database `
    -User "<Identity of target mailbox>"
Advertisement

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 )

Facebook photo

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

Connecting to %s