Changing user's primary smtp address and upn

M4y4 21 Reputation points
2021-11-11T14:51:38.487+00:00

Hi all,
I'm relatively new to Exchange hybrid environment, so I am not quite sure how to approach this.

The user has the e-mail address example@e-mail.com and wants to have it changed to example@anotherdomain.com since there are several forest domains available.
As I understand this, I would have to add the new smtp address and make it primary SMTP, while the old address would be secondary smtp.
If I do this, would UPN have to be changed as well? What are the implications for the user then? The user wants the new address to be their send/receive address and the old one to only receive e-mails.

What are the options?

Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,887 questions
{count} votes

Accepted answer
  1. Benard Mwanza 996 Reputation points
    2021-11-12T08:20:07.78+00:00

    Hi @M4y4

    Its recommended as the best practice to set both UPN and the SMTP(primarysmtpaddress) to the same address.

    If you change the smtp address only, the impact is, the user will be able to receive and send emails from that address(example@anotherdomain.com), but to login to his/her account(office365) they will need to use the old address(example@e-mail.com) because its still the UserPrincipalName.

    To set both primarySMTPAddress and UPN for the user to the same address at the same time use the PowerShell command below.
    Install exchangeonlinemanagement module: Install-module -Name exchangeonlinemanagement
    Then connect to exchangeonline PS, use connect-exchangeonline

    Set-Mailbox -Identity <UPN> -WindowsEmailAddress <thenewaddress> -MicrosoftOnlineServicesID <thenewaddress>

    After running this command, the old address will automatically be set as secondary smtp address, and added to the list of users emailaddresses.

    Note: Changing only the primary SMTP address does not change the UPN.

    To verify that it has worked
    run this command.

    Get-mailbox -identity <thenewaddress> | fl UserPrincipalName, primarySMTPAddress, EmailAddresses

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 141.6K Reputation points MVP
    2021-11-11T15:08:20.433+00:00

    I would recommend making the UPN match the primary SMTP address - its best practice.

    If you change the UPN and the user is using OneDrive, be aware:

    https://learn.microsoft.com/en-us/onedrive/upn-changes

    0 comments No comments