Moving a Exchange 2007/2010 mailbox to another user
In the day to day administration there are situations when you need to switch around domain user accounts on a mailbox. You need to disconnect the user from the mailbox and then connect the new user account. This is very easy in PowerShell.
- Lookup on which storage group/mailbox store the user is connected at this moment (if there is more than 1 storage group)
- Disable the user for Exchange (command-shell): Disable-Mailbox -Identity “Full Username”
This will remove all Exchange properties on the User account in Active Directory (you will be prompted to delete all info). The mailbox will not be deleted. The connection between the account and mailbox will be removed. - Reconnect the mailbox to the account.Use the command-shell :
Connect-Mailbox -Identity “Full Username” -Database “ServerStorage GroupMailboxstore” -User “Domainusername” - Check the properties of the mailbox.
Categories: Exchange 2007, Exchange 2010
Exchange, Microsoft Exchange Server, PowerShell
Can I disable a mailbox, then delete the user, then re-create the user and reconnect the mailbox?
Yes, It should not be a problem. You can see the mailbox in the Recipient Configuration/Disconnected Maibox in EMC too.
it is good to run ‘clean-mailboxdatabase’ after connecting
I must add that to be sure I would do the following:
I am not sure what is meant by “Full username” a mailbox can be identified by its Email Address and a user by domain\samaccountname
1. Get the Database
$owner = Get-Recipient -Identity
$db = $owner.Database.Name
2. Get the Mailbox Guid.
$MBstats = Get-Mailboxstatistics -Identity
$MBGuid = $MBStats.MailboxGuid
3. Disable the Mailbox of user1 to make it disconnected (disabled)
Disable-Mailbox -Identity \ -Confirm:$False
4. CLEAN THE DATABASE!!!
clean-MailboxDatabase -Identity $db
5. Connect up the disconnected Mailbox to other user
connect-mailbox -Identity $MBGuid -Database $db -User \
(6. Depending on email address policy, use set-mailbox to adjust email addresses.)