Recipient name is different than domain mailbox name

JChap 6 Reputation points

We have a hybrid azure active directory and one of our users is hidden from the global address book. When I try to un hide it using the Exchange, it says it is managed by the on-premises directory. So, I then go to the user in the active directory on-site and go into his profile, then to attribute editor. The "HiddenFromAddressListEnabled" is set to <not set> for this user.

When I run the powershell command Get-Recipient -ResultSize unlimited -Filter 'HiddenFromAddressListsEnabled -eq $true' the results show the UserMailbox is listed in the results. However, the name is wrong. Instead of the user named "firstname.lastname" it is labeled "firstname.lastname_domain-1".

I believe the username and everything is synced appropriately for most things in azure active directoy including SSO, but the exchange information does not seem to be matching up completely. There seems to be a duplicate name in exchange for this user that has different hide from GAL settings than what is set for the on-site active directory. How do I change this exchange "HiddenFromAddressListsEnabled true firstname.lastname_domain-1" to "HiddenFromAddressListsEnabled false firstname.lastname"?

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,493 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Piotr Podlawski 86 Reputation points

    Please try to update UPN via Powershell:

    1. Open PowerShell & connect $msolcred = get-credential connect-msolservice -credential $msolcred

    Update the user name:

    Set-MsolUserPrincipalName -UserPrincipalName name.surname@Company portal -NewUserPrincipalName name.surname@Company portal .com

    0 comments No comments

  2. JChap 6 Reputation points

    PS C:\Windows\system32> Set-MsolUserPrincipalName -UserPrincipalName first.last_contoso-1@Company portal -NewUserPrincipalName first.last@Company portal .com
    Set-MsolUserPrincipalName : Access Denied. You do not have permissions to call this cmdlet.
    At line:1 char:1

    • Set-MsolUserPrincipalName -UserPrincipalName first.last_contoso-1@Company portal ...
    • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : OperationStopped: (:) [Set-MsolUserPrincipalName], MicrosoftOnlineException
    • FullyQualifiedErrorId : Microsoft.Online.Administration.Automation.UserNotFoundException,Microsoft.Online.Administration.Automation.SetUserPrincipalName

    I am a global admin, so I know I am supposed to have the appropriate permissions and should not be getting an access denied.
    I am not sure where the Get-Recipient command draws the name from, but the UPN seems to be correct for this user, it is a different naming designation that is mismatched. His mail works fine, he can use all the SSO login just fine. The only thing that doesn't seem to connect right is the attributes from the on-site DC to Exchange online. All the "first.last_contoso-1" should just be "first.last"

    When I run the command: Get-Recipient -Identity 'first.last_contoso-l' | format-list
    the results are below:
    Identity : first.last_contoso-l
    Alias : first.last
    ArchiveGuid : -------Removed----
    AuthenticationType : Managed
    City :
    Notes :
    Company :
    CountryOrRegion :
    PostalCode :
    CustomAttribute1 :
    CustomAttribute2 :
    CustomAttribute3 :
    CustomAttribute4 :
    CustomAttribute5 :
    CustomAttribute6 :
    CustomAttribute7 :
    CustomAttribute8 :
    CustomAttribute9 :
    CustomAttribute10 :
    CustomAttribute11 :
    CustomAttribute12 :
    CustomAttribute13 :
    CustomAttribute14 :
    CustomAttribute15 :
    ExtensionCustomAttribute1 : {}
    ExtensionCustomAttribute2 : {}
    ExtensionCustomAttribute3 : {}
    ExtensionCustomAttribute4 : {}
    ExtensionCustomAttribute5 : {}
    Database : -------Removed----
    ArchiveDatabase : -------Removed----
    DatabaseName : Databases-------Removed----
    Department :
    ExternalDirectoryObjectId : -------Removed----
    ManagedFolderMailboxPolicy :
    EmailAddresses : {SMTP:first.last@Company portal .com, SIP:first.last@Company portal .com, smtp:first.last@Company portal, SPO:SPO_-------Removed----
    ExpansionServer :
    ExternalEmailAddress :
    DisplayName : first last
    FirstName : first
    HiddenFromAddressListsEnabled : True
    EmailAddressPolicyEnabled : False
    IsDirSynced : True
    LastName : last
    ResourceType :
    ManagedBy : {}
    Manager :
    ActiveSyncMailboxPolicy : Default
    ActiveSyncMailboxPolicyIsDefaulted : True
    Name : first.last_contoso-l
    Office :
    ObjectCategory : -------Removed----.PROD.OUTLOOK.COM/Configuration/Schema/Person
    OrganizationalUnit : Exchange Hosted Organizations/
    Phone :
    PoliciesIncluded : {}
    PoliciesExcluded : -------Removed----
    PrimarySmtpAddress :
    RecipientType : UserMailbox
    RecipientTypeDetails : UserMailbox
    SamAccountName : -------Removed----
    ServerLegacyDN : -------Removed----
    ServerName : -------Removed----
    StateOrProvince :
    StorageGroupName : Databases
    Title :
    UMEnabled : False
    UMMailboxPolicy :
    UMRecipientDialPlanId :
    WindowsLiveID : first.last@Company portal .com
    HasActiveSyncDevicePartnership : True
    AddressListMembership : {\All Mailboxes(VLV), \All Recipients(VLV)}
    OwaMailboxPolicy : OwaMailboxPolicy-Default
    AddressBookPolicy :
    InformationBarrierSegments : {}
    WhenIBSegmentChanged :
    SharingPolicy : Default Sharing Policy
    RetentionPolicy : Default MRM Policy
    ShouldUseDefaultRetentionPolicy : False
    MailboxMoveTargetMDB :
    MailboxMoveSourceMDB :
    MailboxMoveFlags : None
    MailboxMoveRemoteHostName :
    MailboxMoveBatchName :
    MailboxMoveStatus : None
    MailboxRelease :
    ArchiveRelease :
    IsValidSecurityPrincipal : True
    LitigationHoldEnabled : False
    Capabilities : {BPOS_S_Standard, SBRM, BPOS_S_BookingsAddOn, MYANALYTICSP2...}
    RootCapabilities : BPOS_S_Standard
    ArchiveState : Local
    SKUAssigned : True
    WhenMailboxCreated : 8/28/2017 2:01:27 PM
    UsageLocation : United States
    ExchangeGuid : -------Removed----
    ArchiveStatus : Active
    SafeSendersHash : -------Removed----
    SafeRecipientsHash : -------Removed----
    BlockedSendersHash : -------Removed----
    WhenSoftDeleted :
    UnifiedGroupSKU :
    ExchangeVersion : 0.20 (
    DistinguishedName : CN=first.last_taktl-l,,OU=Microsoft Exchange Hosted Organizations,DC=-------Removed----,DC=PROD,DC=OUTLOOK,DC=COM
    ObjectClass : {top, person, organizationalPerson, user}
    WhenChanged : 11/20/2022 6:51:29 PM
    WhenCreated : 8/28/2017 2:01:28 PM
    WhenChangedUTC : 11/20/2022 11:51:29 PM
    WhenCreatedUTC : 8/28/2017 6:01:28 PM
    ExchangeObjectId : -------Removed----
    OrganizationalUnitRoot :
    OrganizationId : -------Removed----.PROD.OUTLOOK.COM/Microsoft Exchange Hosted Organizations/ - -------Removed----.PROD.OUTLOOK.COM/ConfigurationUnits/
    Id : first.last_contoso-l
    Guid : -------Removed----
    OriginatingServer : -------Removed----
    IsValid : True
    ObjectState : Unchanged

    0 comments No comments

  3. JChap 6 Reputation points

    Sorry, about it being posted a few times. When I opened the window, it was not populating so I added it again. I will try to clean the repeats out.

    0 comments No comments