Is the legacyExchangeDN attribute changed during mailbox-enabling of a mail-enabled account object?
Yes, the value is set using the Administrative Group of the target object combined with the first part of its User Principal Name (UPN), i.e. the part before the @ sign.