Is it possible to get the Primary Email Adress of a user that has a different username as the Primiry email address using Microsoft Graph API?

yeison bernal 21 Reputation points
2022-04-12T19:43:14.083+00:00

Hello,
I'm working on an application that has synchronization with Outlook and the subscription is being made with the email address. However, there are cases where a Primary email address is different from the username of the user, in those cases the synchronization is breaking.

192482-image.png

Is there a way to get The primary email address of a user that has change his username, as in the image?
Cause i have tried with the different user properties but I have not being able to get the Primary Email Address.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Zehui Yao_MSFT 5,876 Reputation points
    2022-04-13T06:04:56.123+00:00

    Hello @yeison bernal , the otherMails property can list additional email address for the user, try to get user by primary email address using following API.

    https://graph.microsoft.com/v1.0/users?$filter=otherMails/any(c:c eq '{Primary Email Address }')  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. yeison bernal 21 Reputation points
    2022-05-02T12:53:54.567+00:00

    Hello, in this specific case where the primary email address is different from the Username the way that i found to get the Primary Email Address in this call.

    https://graph.microsoft.com/v1.0/users/{Id | UserName}/proxyaddresses

    0 comments No comments

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.