top of page
  • Writer's pictureAdrian Dolder

Offline Exchange Migration / Import & Export


If you are planning an Offline Exchange Migration or a Migration without a Trust from one Active Directory Forest to another, it is important that you also take the Legacy X500 address from the old system to the new.

The reason for this is, that the mails are locally delivered by the X500 address and not the primary SMTP address like this happens normally with mails from the internet.

If the mailboxes are moved to another Exchange server (not connected to the previous Exchange server), the X500 address is not taken. This means, that users receive a "failed delivery" confirmation when responding to an email or when sending an email to an address in their cache. E.g. even if a booked appointment need to be moved (for example, with a meeting room / resource).

To avoid this problem, an export of the Legacy X500 address to a CSV can be created using PowerShell and then imported again into the new Active Directory structure with PowerShell.

EXPORT LEGACY X500 ADDRESSES

PowerShell

Get-ADUser -SearchBase “OU=legacyusers,DC=domain,DC=local” -Filter * -Properties SamAccountName,legacyExchangeDN | Select-Object SamAccountName,legacyExchangeDN | Export-CSV C:\UserExport.csv -NoTypeInformation

IMPORT LEGACY X500 ADDRESSES TO THE NEW DOMAIN

On a domain controller or a client with the Active Directory PowerShell Module installed, the UserExport.csv must be copied to the path C:\.

Now you need to create a PowerShell script called legacyusers.ps1, which contains the following code:

-------------------------------------------------------------------------------------

Import-Module ActiveDirectory $csv = Import-CSV C:\temp\UserExport.csv -Delimiter "," ForEach ($ADUser in $csv){ if ($ADUser.legacyExchangeDN){ Set-ADUser -Identity $ADUser.SamAccountName -add @{proxyAddresses=”X500:$($ADUser.legacyExchangeDN)”} } }

-------------------------------------------------------------------------------------

Save and run this script on the domain controller. To check if it has worked, a user can be opened and the attribute proxyAddresses can be verified.

ATTENTION:

Before starting the import, the CSV file need to be adapted because of false symbols.

After the export, the CSV looks like this


For the import, the CSV needs to look like this


The yellow marks need to be adjusted


#Exchange #Migration #NoTrust #ImportExport #LegacyX500 #X500

328 views0 comments

Recent Posts

See All

Talking Microsoft

A BLOG ABOUT SECURITY, EXCHANGE, TEAMS, MICROSOFT 365 AND MORE

DOUDISBLOG
  • Doudisblog on Facebook
  • Doudisblog on Twitter
  • Mail
  • Doudisblog RSS
  • Doudisblog Youtube Channel
  • Adrian Dolder - LinkedIn
  • Xing_Button
  • Doudisblog
bottom of page