Unable to set a user's email address

Ian Brian 1 Reputation point
2021-11-03T10:52:24.673+00:00

In Azure AD I want to edit a user and set the Email in Contact info. On saving, the message "unable to update user profile" is displayed. I presume this is because there is conflict with that email being set on another user or elsewhere in the portal. I have tried to find where and failed. One possibility is that it is because I sent an invitation to a new user with that email address but can no longer see that invitation. When the user tried to accept the invitation he got an error. I don't rule out the possibility that I deleted the invitation and forgot doing so. I'm new to Azure administration and not finding it very intuitive.

Does anyone have any idea how to get around this?

Why doesnt't the error message specify the reason for the error? It could provide all the information needed to understand why the update fails.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,871 Reputation points Moderator
    2021-11-03T14:02:52.22+00:00

    Hi @Ian Brian • Thank you for reaching out.

    You can check details about the error by checking the audit logs:

    Azure AD > Users > click on the user account you are unable to set the email address for > Audit logs > look for Activity type: Failure and Status: Failure events, as shown below:

    146232-image.png

    If you are getting the DirectoryUniquenessException, you can use the below PowerShell cmdlets to find which user account is already configured with that email address:

    Connect-AzureAD #Sign-in using user administrator or global administrator account.  
    Get-AzureADUser | Where-Object {$_.mail -eq "mail@example.com"}  
    

    You can then remove the email from the existing user to resolve the conflict that is causing DirectoryUniquenessException.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.