Simple powershell one liner to change legacyExchangeDN?
Can anyone share a simple clean short, to the point, one line powershell that changes the legacyExchangeDN value on one mailbox?
October 18th, 2012 12:41pm

Well, I would want to know why you want to change it first :) That is typically not a good idea. Better to add the legacyExchangeDN as an additional Custom X500 address to the account instead.
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 1:30pm

Well, I would want to know why you want to change it first :) That is typically not a good idea. Better to add the legacyExchangeDN as an additional Custom X500 address to the account instead. The account needs the legacyExchangeDN attribute corrected from being established wrong then changed through the ADUC ui. I want to know how to edit the value via a short powershell command. I found how to list it, I just can't set it. Is there a small clean example of powershell to set it on one user?
October 18th, 2012 1:35pm

I would look at this perhaps Note that changing this will affect cached entries and replies from Outlook users.
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 1:41pm

I would look at this perhaps Note that changing this will affect cached entries and replies from Outlook users. Thanks, unfortunately I found that example already. It's not what I'd consider a simple one liner though. I don't write code and I don't have time in a day to craft powershell scripts. Is there maybe another simpler one? Anyone?
October 18th, 2012 1:54pm

Does it really need to be done in Powershell? I would just change it using adsiedit.msc
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 2:01pm

I would not change the legacyExchangeDN for the issues Andy cited, I would add the old legacyExchangeDN to the proxy addresses as a custom entry though, it will have practically the same effect aside from the nasty missing cache entry issue. Set-Mailbox <user> -EmailAddresses @{add="X500:/o=<ExOrg>/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Userabc"} If you really must change it, you can flip flop them by using: import-module ActiveDirectory $user=<username> $NewExDN=<NewLegacyExchangeDN> $OldExDN = $(Get-Mailbox $user).LegacyExchangeDN Set-Mailbox $user -EmailAddresses @{Add="X500:$OldExDN"} Set-ADUser $user -Replace @{legacyExchangeDN=$NewExDN} Just put the username in and the the legacyExchangeDN you want, and the script will move the existing legacyExchangeDN to the proxyAddresses and change the existing legacyExchangeDN attribute. *** Use at your own risk, unforseen issues can come from changing this attribute ***
October 18th, 2012 3:07pm

So then, it cannot be done via powershell in a simple manner. That's what I'm taking away from this thread and all the dead end threads out there. OK.
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 3:16pm

So then, it cannot be done via powershell in a simple manner. That's what I'm taking away from this thread and all the dead end threads out there. OK. The LegacyExchangeDN is one of those special attributes that should rarely be missed with, so that is most likely why you dont see any built-in tools to manipulate it.
October 18th, 2012 3:18pm

On Thu, 18 Oct 2012 17:28:44 +0000, Andy D- wrote: >I would look at this perhaps > >Note that changing this will affect cached entries and replies from Outlook users. .... and ownership of items in calendars, especially any "shared" calendars. Changing the LDN isn't a good idea. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2012 5:37pm

If you need to change the legacyExchangedn for users, you can use ADmodify to help you do that. Introduction to ADModify.net http://technet.microsoft.com/en-us/library/aa996216(EXCHG.65).aspx Thanks, Evan Liu TechNet Subscriber Support in forum If you have any feedback on our support, please contact tnmff@microsoft.com Evan Liu TechNet Community Support
October 19th, 2012 4:42am

How about the issue, any updates? Thanks, Evan Liu TechNet Subscriber Support in forum If you have any feedback on our support, please contact tnmff@microsoft.com Evan Liu TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
October 24th, 2012 6:15am

I was forced to use ADSI Edit when I could not change it through power shell.
October 24th, 2012 1:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics