Exchange 2010: How to Convert Mailbox to MailUser
Introduction
Note: This article currently consists only of a template. Content will be added soon. If you are familiar with this event, please consider adding any troubleshooting tips that may help the community. Thank you! This topic describes how to troubleshoot .
Issue Description
We had exchange hosted environment and later on one of the existing customer implemented their own exchange infrastructure and they planned to migrated Exchange mailboxes to their own Exchange Data Center. Post migration of mailboxes via Quest Tool they left the mailboxes in source exchange environment however they had Target address pointed to External email domain address. Our management decided to decommission/Remove migrated customer mailboxes from environment however they don't want people getting the non-delivery email when existing people sending email from cache address. So we decided to convert existing mailboxes to MailUser and add existing Legacy DN as X500 address in order to avoid any email delivery issues.
Resolutions
To convert the Mailboxes to Mail User, I build the below script and it was completed without any issues.
input = import-csv .\usersdetails.csv
foreach ($usr in $input){
$ht = @{
'EAddress'=$usr.Mailbox
'DC'=$usr.Domaincontroller
'ExAddress'=$usr.ExternalEmailAddress
}
# get the user
$user = Get-Mailbox -DomainController $ht['DC'] -Identity $ht['EAddress']
# get curret email addresses
$currAddresses = $user.EmailAddresses
# get the X500 address
$legDn = $user.LegacyExchangeDn
# add the legacy DN to the list
$currAddresses="X500:" +$legDn
# disable the old mailbox
Disable-Mailbox -DomainController $ht['DC'] -Identity $ht['EAddress'] -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
Start-Sleep -s 2
# Mail enable the user account
Enable-MailUser -Identity $ht['EAddress'] -DomainController $ht['DC'] -ExternalEmailAddress $ht['ExAddress'] -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
Start-Sleep -s 2
# get the new user
$newUser = Get-MailUser -DomainController $ht['DC'] -Identity $ht['EAddress']
# set the new addresses
Set-MailUser -DomainController $ht['DC'] -Identity $newUser -EmailAddressPolicyEnabled $false -ExternalEmailAddress $ht['ExAddress'] -CustomAttribute5 "EXCLUDED" -EmailAddresses $ht['ExAddress'],$currAddresses -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
}
Verification
To verify that , do the following:
Exchange 2010 and Exchange 2013.