Offline Exchange Migration / Import & Export

Migrated from old website (first published Oct 13, 2017 )

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.


  1. Export legacy X500 addresses
    1. PowerShell
  2. Import legacy X500 addresses to the new domain
  3. Attention
  4. How does it look like
    1. After the export, the CSV looks like this
    2. For the import, the CSV needs to look like this
    3. The yellow marks need to be adjusted

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.

How does it look like

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

Leave a comment

Blog at WordPress.com.

Up ↑