Importing legacyexchangedn from csv file

Posted on 2008-10-30
Last Modified: 2011-09-20
My company has split from it's parent organization and I am migrating our users to a new 2007 Exchange server. I have a csv file of (new) smtp addresses and the old legacyexchangedn data to import into the new Exchange attributes. I would like to have the users be able to reply to migrated emails and continue to function seamlessly with existing calendar appointments.

Can anyone tell me the correct syntax to import a file with smtp address and add the old x500 information?
Question by:susjdavis
  • 4
  • 2
LVL 33

Expert Comment

ID: 22848671
you got it exactly right that X500 should be added as legacyexchangedn value for replying to old emails (emails sent to you when mailboxes existed in previous organization)

However, this x500 value needs to be added in proxyAddresses - in other words your email address gets modified with another secondary email address added. No need to panic since this is an X500 address and not a modification to primary SMTP address. Mentioned below are the steps taken using the tool ADMODIFY to make bulk user changes.


1] Open ADModify.NET with an account that has Domain Admin permissions and select Modify Attributes
2] From the Domain List: drop down box, choose the Domain you will work with.
3] From the Domain Controllers List: drop down box, choose the Domain controller you will work with.
4] Place or remove checkmarks to select the mail enabled objects you wish to modify.
5] Select the arrow to the right to search the domain.
6] From the search results select the OU you want to work with and select, Add To List->
7] You can highlight individual Users from the details pane on the right or choose Select All.
8] Select NEXT; a new screen will appear, select the CUSTOM Tab
9] Under Custom Attribute Set, place a check mark by: Make a customized modification
10] By Attribute Name: enter: proxyAddresses
11] By Attribute Value: enter the X500 address

For example, if you want an X500 address of:

Then for Attribute Value enter:

In this example the %'mailnickname'% variable is used because it is assumed that
the Users mailnickname attribute, in the new Organization, matches the mailnickname
attribute in the old Organization. If not, other variables can be used for this

12] In order to add the X500 proxy address to the existing proxyAddresses place a
check mark by: Multivalued Append
13] Select GO!

Author Comment

ID: 22850943
Unfortunatley - there is no standard on the old x500 addresses for the %nickname% field. I have at least three differnent naming conventions coming from the old exchange org and none of the three match the current (firstinitiallastname) alias in the new AD domain.
I had found the following on the net explaining how to import via a csv file if you had the correct alias and legacyExchangedn:

Import-CSV file.csv | foreach {

$Temp = Get-Mailbox -identity $_.alias

$Temp.EmailAddresses += X500 + $_.legacyexchangedn

set-mailbox -instance $temp} 

However - I'm not 100% on using the smtp address as the unique identifier instead of the alias name.
I'm also getting errors when trying to test the script at the $temp.emailaddresses.
LVL 33

Expert Comment

ID: 22852871
"Unfortunately - there is no standard on the old x500 addresses for the %nickname% field. I have at least three differnent naming conventions coming from the old exchange org and none of the three match the current (firstinitiallastname) alias in the new AD domain"

Look, it seems either you are confused or i am feeling sleepy. X500 over the years has always been used in context with mailNickname attribute. This attribute derives from only one attribute that is ALIAS.

The change i asked you to make using adsiedit was keeping in mind that your present alias would match your previous Org alias.

What you are stating that you have THREE naming convention - this is practically impossible - since Exchange would pickup ONLY ALIAS Attribute for its own mailNickname - You cannot have 3 types of alias and mailNickname.

The fact that i wanted to share these steps with you was - since this has worked without an hitch on previous occasions.

Yes, if you current alias is different then your script would also Fail - i would also answer that why.

Import-CSV file.csv | foreach {

$Temp = Get-Mailbox -identity $_.alias <=== This is trying to store the present alias
(which as per you is not the same as previous organization) - so why proceed to step2

$Temp.EmailAddresses += X500 + $_.legacyexchangedn <==== This is storing the legacyexchangedn value with x500 attached to it. - LegacyExchangeDN would require mailNickname at the end of its value.

set-mailbox -instance $temp}
At this point probably you are trying to merge both the information. Which should be incorrect since you stated.

"I have at least three differnent naming conventions coming from the old exchange org and none of the three match the current (firstinitiallastname) alias in the new AD domain."

I am again stating please do not confuse between mailNickname attribute and email address - Both these are different.
Email address derive their proxyaddress from recipient polices.
mailNickname derives its presence from alias and helps further only in legacyExchangeDN value.
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

LVL 33

Expert Comment

ID: 22852884
And yes i did confirm with my colleagues in MSFT - your script and my method are practically the same.
Just that i would be using the GUI and script would show you the shell interface.

Author Comment

ID: 22852971
My organization has gone through at least three cross-organization exchange migrations in the past few years. Currently, the mail boxes are being hosted on another domain at a hosting facility.

The legacyExchangeDN on the hosted mailboxes "nicknames" are from the trusted domain and not the domain I will be migrating into. They range from firstname.last, firstname lastname, firstname, firstinitiallastname, etc. These mailboxes have been migrated several times.

My question is - is there a way to MODIFY the above script to pull in legacyexchangedn from a csv file with two columns:
smtp address (since I do not have the correct alias')
LVL 33

Accepted Solution

Exchange_Geek earned 500 total points
ID: 22853316
Not to a limit i am aware of. You may open a case with MSFT for this - but i doubt they can do anything better on such scenarios.

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question