PowerShell-Bulk Export & Import of X500

PowerShell-Bulk Export & Import of X500

One of the most important thing to take care is the X.500 Address when you are doing Direct Cut Over migration from Microsoft Exchange Server to a new Exchange Server in different AD Domain or Office 365

The X.500 Address is used by Microsoft Outlook to identify users (NOT SMTP Address) within Exchange Organization (Refer to the http://www.askme4tech.com/exchange-server-x500-address-amazing-thing-know for more detail information.

Please refer to the steps below on how to export & import X.500 using PowerShell Script

Export X.500 from Exchange Server
Export existing X.500 Address (LegacyExchangeDN) from Exchange Server

Get-Mailbox | Select Name, PrimarySMTPAddress, legacyExchangeDN | Export-Csv C:\temp\X500.csv -NoTypeInformation

You will get the X500.csv file similar as below

Name PrimarysmtpAddress LegacyExchangeDN
Administrator Administrator@xxx.com /o=XXXXX/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=1f978775da0c4306944356cbf639092d->/td>

Import X.500 to Exchange Server – Additional EmailAddresses
Import the X.500 Address to users provisioned in New Exchange Server / Office 365 without overriding existing SMTP Address

$Users=import-csv C:\Temp\X500.csv
foreach ($User in $Users) { 

$x500="X500:"+$User.LegacyExchangeDN

set-mailbox -Identity $User.PrimarySmtpAddress -EmailAddresses @{Add=$x500} 
}

Notes:

  1. We will need to add X500: when insert the exported X.500 Address to Email Addresses
  2. @ – to add the additional X.500 Address without overriding existing values

To verify the X.500 Address had been inserted successfully

Get-Mailbox $Mailbox | Select EmailAddresses

Exported X.500 Address had been added to EmailAddresses while the existing sip & SMTP Address are remained

EmailAddresses : {X500:/o=xxx/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=9eca23cf6fcf41deb075762f49a5ab9e-, sip:it@xxx.com.my, SMTP:it@xxx.com.my}



created with the free version of
Markdown Monster

Leave a Comment