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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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.
Office 365 Training for Admins

Learn how to provision tenants, synchronize on-premise Active Directory, and implement Single Sign-On with these master level course.  Only from Platform Scholar

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

Office 365 Advanced Training for Admins

Special Offer:  Buy 1 course, get 2nd free!  Buy the 'Managing Office 365 Identities & Requirements' course w/ Accelerated TestPrep, and automatically receive the 'Enabling Office 365 Services' course FREE!

Question has a verified solution.

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

Suggested Solutions

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
This video discusses moving either the default database or any database to a new volume.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

734 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