Cloudiway platforms provides a global task to migrate the legacyExchangeDN.
This article explains where and when to use it.
There is a global task named “Transfer X500” under the mail migration tool.
Essentially, it reads the legacyExchangeDN at the source and migrate them to the proxyAddresses in Office 365.
However, if a local Active Directory is synchronized with Office 3655 through Azure AD Connect, Office 365 becomes readonly and therefore the Cloudiway platform cannot modify the users anymore (cannot edit their proxyaddresses).
In this case, you must then proceed diferently and migrate manually the legacyExchangeDN to your local AD which will then replicate the changes to Office 365 through Azure ADConnect.
Here is a way to do it. Note that we are providing the main steps. Cloudiway is not doing support on Active Directory or Azure AD Connect.
Consider the following steps as the main “lines” to follow. Cloudiway cannot assist or support you during your implementation of the following lines.
Export the LegacyExchangeDN
For OnPremises Exchange server:
CSVDE -s <DC QDN> -d “OU=xxx,DC=domain,DC=local” -p SubTree -l SamAccountName,legacyExchangeDN -r objectClass=user -f C:\temp\Users.csv
For Office 365
Once you have opened an Exchange connection to office 365, run:
Get-Mailbox -Filter {Emailaddresses -like “*domain.com*”} |select PrimarySmtpAddress,LegacyExchangeDN |Export-Csv “C:\temp\users.csv
Import the LegacyDN to Active Directory.
Import-Module ActiveDirectory
$Input = Import-CSV C:\temp\Users.csv
ForEach ($ADUser in $Input)
{
if ($ADUser.legacyExchangeDN)
{
Set-ADUser -Identity $ADUser.SamAccountName -add @{proxyAddresses=”X500:$($ADUser.legacyExchangeDN)”}
}
}
Note: if you are importing the legacyExchangeDN from Office365 to AD, you may need to change the script above and extract a “key” from office 365 that will match the identity in Active Directory. This may be the UPN, or a combinaison of FirstName / LastName