Solving Deleted contacts problem after losing LegacyExchangeDN Address

So here is the story.

I was doing a cross forest project and one of the IT guys I was working with deleted the contacts and then all users in the target forest started complaining that they couldn’t send emails to the source forest users.

Once we got contacts back from the backup they came with a new LegacyExchangeDN address which resulted in failing again.

In order to solve the problem we had two options, First is to delete autocomplete for all users which was a very difficult option and hard to approve since there are more than 6000 users who will lose their Auto complete.

The other option was to get the old LegacyExchangeDN address from users’s outlook which was even more difficult but from a management point of view was the way to go.

Using NK2Editor with its commands I managed to configure Script through GPO to get all the Autocomplete files from users.

Steps are as following:

1- Create a shared folder on one computer that all users can access (Usually Sysvol would do the job). Or place the Nk2Editor in the sysvol folder and run the command against all users from there.

2- Using GPO create a script policy to convert the currently used Default Autocomplete file using Nk2Editor’s command capability into CSV file

.\NK2Edit.exe /ExportCharEncoding 1 /scomma “$env:USERNAME.csv”

3- Copy the CSV file to the shared folder (you can do this using Powershell as well).

4- Extract FullName and X500 columns from users’s CSV files into one file in order to apply it with the following script.

Import-CSV C:\username.csv | foreach{Set-MailContact -identity $_.Name -EmailAddresses @{add=$_.LegacyExchangeDN}}

The CSV file that you got with NK2editor should be filtered to include only Name (Display name) and the Email address (LegacyExchangeDN).

This should do the work. I hope it helps someone who is stuck in the same situation.

2 thoughts on “Solving Deleted contacts problem after losing LegacyExchangeDN Address”

  1. Can we automate this tool? E.g. if we have daily csv file getting created in some folder, can we schedule sf data loader to pick up that file and automatically insert, update data?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.