Quick & Dirty: Convert IMCEAEX strings to X500

I had this problem before in a other articles described: Users receive an undeliverability report (NDR) when attempting to send to mailboxes or distribution lists. The field code in the NDR is "550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found'. Here is an example of such an NDR:

Convert IMCEAEX strings to X500

The problem occurs, for example, when a distribution list has been migrated to a shared mailbox. The e-mail address remains the same, but the "LegacyExchangeDN" changes. Outlook still uses this attribute for auto-completion. If a user has already sent mails to a distribution list and therefore saved the entry in their autocomplete, the NDR shown above occurs after the change (in this case distribution list to shared mailbox).

If it only affects a few users, the old entry can simply be deleted:

Convert IMCEAEX strings to X500

However, if it affects many users, this is probably no longer an option. As described in the article linked above, the LegacyExchangeDN can be assigned as an X500 entry to the new distribution list or mailbox to avoid the problem.

However, if you no longer have the old LegacyExchangeDN, the IMCEAEX string from the NDR can also be converted into an X500 entry and assigned.

This small PowerShell function converts the IMCEAEX string into X500 strings:

function ConvertTo-X500{
Param(
[parameter(Mandatory=$true)]
[String]
$IMCEAEX
)
$IMCEAEX = $IMCEAEX.replace("_","/")
$IMCEAEX = $IMCEAEX.replace("+20"," ")
$IMCEAEX = $IMCEAEX.replace("+28","(")
$IMCEAEX = $IMCEAEX.replace("+29",")")
$IMCEAEX = $IMCEAEX.replace("+40","@")
$IMCEAEX = $IMCEAEX.replace("+2E",".")
$IMCEAEX = $IMCEAEX.replace("+2C",",")
$IMCEAEX = $IMCEAEX.replace("+5F","_")
$IMCEAEX = $IMCEAEX.replace("IMCEAEX-", "X500:")
$IMCEAEX = $IMCEAEX.split("@")[0]
return $IMCEAEX
}

The function can now be used in scripts or directly in the PowerShell:

Convert IMCEAEX strings to X500

In this small example, an IMCEAEX string from an NDR is converted into an X500 entry and then assigned to the mailbox:

$MailboxAlias = "frank"
$IMCEAEXString = "IMCEAEX-_O=Frankys+20Web_OU=EXCHANGE+20ADMINISTRATIVE+20GROUP+20+28FYDIBOHF23SPDLT+29_CN=RECIPIENTS_CN=Zoechling+20SFrankd9c@frankysweb.local"
function ConvertTo-X500{
Param(
[parameter(Mandatory=$true)]
[String]
$IMCEAEX
)
$IMCEAEX = $IMCEAEX.replace("_","/")
$IMCEAEX = $IMCEAEX.replace("+20"," ")
$IMCEAEX = $IMCEAEX.replace("+28","(")
$IMCEAEX = $IMCEAEX.replace("+29",")")
$IMCEAEX = $IMCEAEX.replace("+40","@")
$IMCEAEX = $IMCEAEX.replace("+2E",".")
$IMCEAEX = $IMCEAEX.replace("+2C",",")
$IMCEAEX = $IMCEAEX.replace("+5F","_")
$IMCEAEX = $IMCEAEX.replace("IMCEAEX-", "X500:")
$IMCEAEX = $IMCEAEX.split("@")[0]
return $IMCEAEX
}
$ProxyAddresses = (Get-Mailbox $MailboxAlias).EmailAddresses
$x500 = ConvertTo-X500 -IMCEAEX $IMCEAEXString
$x500 = [Microsoft.Exchange.Data.CustomProxyAddress]("$x500")
$ProxyAddresses += $x500
Set-Mailbox $MailboxAlias -EmailAddresses $ProxyAddresses

Convert IMCEAEX strings to X500

The script can also be adapted for distribution lists with little effort.

11 thoughts on “Quick & Dirty: IMCEAEX Strings in X500 konvertieren”

  1. Hallo,

    ich habe das Problem mit EmailKontakten und nicht mit Postfächern.
    Diese wurden gelöscht & mit neuen Informationen (Telefonnummer etc.) via Powershell neu eingspielt.
    Ist es möglich, dass es dort dasselbe Problem ist? Allerdings haben diese gar keine explizite x500 Adresse.

    LG

    Reply
    • Hallo, ich hab das selbe Problem mit den Kontakten gehabt.
      Das Skript leicht angepasst, so dass eine X500-Adresse neben der primären SMTP Adresse hinzugefügt wird (aus dem legacyexchangedn).
      Damit scheints jetzt zu laufen ohne NDR. Wenn du das angepasste Skript haben willst, sag Bescheid.

      Reply
  2. Hallo,

    wir haben hier auch ein sehr komischen Problem. Die Mailboxen wurden von einem SBS 2008 exportiert, in Office 365 manuell angelegt und die PST wieder importiert.

    Jetzt schickt man eine Mail von Meet-Google (also keine Outlook) eine Einladung an USER_A@domain.de. Dann wird die Mail nicht zugestellt mit dem Fehler:
    imceaex-_o=kunde_ou=first+20administrative+20group_cn=recipients_cn=USER_B@deupXXX.prod.outlook.com

    Das interessant daran ist, dass der DN nicht USER_A ist, sondern USER_B. Bei dem User_B handelt es sich um ein Postfach, dass es mal gab aber am alten Exchange 2007 gelöscht wurde und nie migriert wurde. Bin mir nicht ganz sicher, aber es kann sein, dass man die Mailadresse von USER_B mal dem USER_A als weitere Adresse hinzugefügt hat um evtl. Mails von USER_B noch zu bekommen. Wenn ich User_A den X500 hinzufüge von USER_B dann kommen die Mails an.

    Kann mir das jemand erklären?????
    Vielen lieben Dank
    Thomas

    Reply
    • Hallo Thomas,

      ich habe das gleiche Problem. Bitte lass es mich wissen, wenn du hier bereits eine Lösung gefunden hast.
      Vielen Dank dir schon einmal!

      mit freundlichen Grüßen
      Robert

      Reply
  3. Moin,
    ich habe das Problem, dass bei mir einige Mitarbeiter-Kontakte im Outlook 2016 zwar richtig angezeigt und ich auch Mails verschicken kann aber auf auf dem Handy, welches per ActiveSync (Exchange 2013) syncronisiert wird, der IMCEAEX-String steht. Woran kann das liegen?

    Gruß

    Mathias

    Reply
  4. Vielen Dank für das Skript. Wenn in dem IMCEAEX String „+40“ vorkommt, wird zu viel abgeschnitten. Die Zeile „$IMCEAEX = $IMCEAEX.split(„@“)[0]“ muss vor der Zeile „$IMCEAEX = $IMCEAEX.replace(„+40″,“@“)“ stehen.

    Reply
  5. Hallo,
    ist es möglich die Funktionalität einer X.500 Adresse zu testen, ohne den Rechner zu haben auf dem das Problem auftritt?
    Gruß
    Katja

    Reply

Leave a Comment