Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

MailNickName or Alias attribute in Exchange Online doesn't match what is set in Exchange on-premises


View products that this article applies to.

Symptoms

The Alias or Mailnickname attribute in Microsoft Exchange Online doesn't match what is set in the Exchange on-premises environment for a synced user account.

↑ Back to the top


Cause

This issue occurs if changes are made to the user principal name (UPN) for the user and the Mailnickname attribute value is changed to the prefix of the UPN.

↑ Back to the top


Resolution

To resolve this issue, update the Alias or Mailnickname attribute. To do this, use one of the following methods.
 

Method 1: Use Exchange Management Shell

  1. Change the existing Alias attribute value so that the change is found by Azure Active Directory (Azure AD) Connect. This should sync the change to Office 365. To do this, use either the Set-Mailbox or Set-RemoteMailbox cmdlet, based on the recipient type in Exchange on-premises. 

    Set-RemoteMailbox
    $alias=Get-remotemailbox user@domain.com
    Set-RemoteMailbox user@domain.com -alias "$($alias.alias)1"
    

    Set-Mailbox
     
    $alias=Get-mailbox user@domain.com
    Set-Mailbox user@domain.com -alias "$($alias.alias)1"
    
     
  2. Start a Delta sync from Azure AD Connect, or wait for Azure AD Connect to run the delta. Ideally, this should sync the changes that are made in step 1 to Office 365.
  3. Change the value of the Alias attribute to its original value. To do this, run either of the following cmdlets:
     
    Set-RemoteMailbox user@domain.com -alias "$($alias.alias)"
    Set-Mailbox user@domain -alias  "$($alias.alias)"
    
     
  4. Start a Delta sync from Azure AD Connect, or wait for Azure AD Connect to run the delta> Ideally, this should sync the changes to Office 365.
 

Method 2: Use Active Directory PowerShell Module

  1. Change the Mailnickname attribute value so that the change is discovered by Azure AD Connect. This should sync the change to Office 365. To do this, run the following set of cmdlets: 
     
    $mailnickname=Get-ADUser -Properties * -Filter {name -like 'username*'}
    Get-ADUser -Properties * -Filter {name -like 'username*'} | set-aduser -replace @{mailnickname="$($mailnickname.mailnickname)1"
    
     
  2. Start a Delta sync from Azure AD Connect, or wait for Azure AD Connect to run the delta. Ideally, this should sync the changes that are made in step 1 to Office 365.
  3. Change the value of the Mailnickname attribute to its original value. To do this, run the following cmdlet: 
     
    Get-ADUser -Properties * -Filter {name -like 'username*'} | set-aduser -replace @{mailnickname="$($mailnickname.mailnickname)"
     
  4. Start a Delta sync from Azure AD Connect, or wait for Azure AD Connect to run the delta. Ideally, this should sync the changes that are made in step 1 to Office 365.

↑ Back to the top


Keywords: Administrator Tasks, vkb231, kb, exo, vkbportal250, vkbportal226

↑ Back to the top

Article Info
Article ID : 2824766
Revision : 16
Created on : 11/19/2019
Published on : 11/19/2019
Exists online : False
Views : 176