Manchmal gibt es die Anforderung einen Exchange Server nicht auf dem herkömmlichen zu migrieren. Oft wird sich dann für eine PST-Migration, also der Export der Postfächer aus dem Quellsystem und der anschließende Import der Daten in die Zielpostfächer entschieden. Dieser Weg wird häufig bei Cross-Forrest Migrationen gewählt, gerade bei einer überschaubaren Anzahl von Postfächern lohnt allerdings der Einsatz von Spezialsoftware, wie zum Beispiel „Migration Manager for Exchange“ der Firma Dell, meist nicht.
However, a small detail is often forgotten in this type of migration: When the mailboxes are created in a new overall structure, a new LegacyExchangeDN is assigned, especially if the name of the overall structure changes.
However, the LegacyExchangeDN attribute is used by Outlook for a few important things, such as auto-completion of e-mail addresses and assigning people to appointments.
Here is a small example:
Ich habe im Outlook Cache einen Eintrag für „Mailbox1“
Mailbox1 has this LegacyExchangeDN:
/o=FrankysWeb/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=ce3ee9150f424250bda67e2a6e062aea-Mailbox1
As soon as the LegacyExchangeDN changes because the mailbox is now in a new overall structure, for example to :
/o=FrankysWebNEW/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=ce3ee9150f424250bda67e2a6e062aea-Mailbox1
Then the following happens:
The user receives an undeliverable message with the following content:
Error during message delivery to the following recipients or groups:
Mailbox1
The e-mail address entered could not be found. Check the recipient's e-mail address and try to send the message again. Contact the helpdesk if the problem persists.
Diagnostic information for administrators:Generating server: EX1.frankysweb.local
IMCEAEX-_o=FrankysWeb_ou=Exchange+20Administrative+20Group+20+28FYDIBOHF23SPDLT+29_cn=Recipients_cn=ce3ee9150f424250bda67e2a6e062aea-Mailbox1@frankysweb.local
Remote Server returned ‚550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found‘
The background is as follows: Outlook does not save the e-mail address, but the LegacyExchangeDN. Incidentally, it does not matter which Exchange or Outlook version is used, the behavior is the same everywhere.
There is a simple solution to avoid this problem. The old original LegacyExchangeDN must be assigned as X500 address to the corresponding mailbox.
So if the child has already fallen into the well, the X500 address can be determined from the undeliverability report as follows:
- Replace any underscore character (_) with a slash character (/).
- Replace „+20“ with a blank space.
- Replace „+28“ with an opening parenthesis character.
- Replace „+29“ with a closing parenthesis character.
- Delete the „IMCEAEX-“ string.
- Delete the „@mgd.domain.com“ string.
- Add „X500:“ at the beginning.
So in my case:
X500:/o=FrankysWeb/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=ce3ee9150f424250bda67e2a6e062aea-Mailbox1
This address can now be assigned via shell or GUI:
As soon as the X500 address has been added, sending mail to addresses from the autocomplete function will work again.
However, if you are planning a migration with PST export/import, you can make your life easier straight away:
The following script can be used to export the LegacyExchangeDNs of all mailboxes from the source system and import them back to the target system as X500 addresses. A CSV file and the mode (export/import) must be specified as parameters. The script requires the same aliases for the import.
param ( [Parameter(Mandatory=$True)] [string]$CSVFile , [Parameter(Mandatory=$True)] [string]$FunctionLevel ) if ($FunctionLevel -notmatch "Import" -and $FunctionLevel -notmatch "Export") { write-host "Nur Import oder Export als Parameter gültig" exit 0 } if ($FunctionLevel -match "Export") { "SamAccountName;Alias;LegacyExchangeDN" | set-content $csvfile $mailboxlist = get-mailbox -resultsize unlimited foreach ($mailbox in $mailboxlist) { $samaccount = $mailbox.SamAccountName $legacydn = $mailbox.LegacyExchangeDN $alias = $mailbox.Alias "$samaccount;$Alias;$legacydn" | add-content "$csvfile" } } if ($FunctionLevel -match "Import") { $mailboxlist = import-csv $csvfile -delimiter ";" foreach ($mailbox in $mailboxlist) { $samaccount = $mailbox.SamAccountName $legacydn = $mailbox.LegacyExchangeDN $alias = $mailbox.Alias $ProxyAddresses = (Get-Mailbox $alias).EmailAddresses $x500 = "X500:" + "$legacydn" $x500 $x500 = [Microsoft.Exchange.Data.CustomProxyAddress]("$x500") $ProxyAddresses += $x500 Set-Mailbox $alias -EmailAddresses $ProxyAddresses } }