Will Graph List User API return users with empty userPrincipalName?

Scott Jiang 21 Reputation points
2022-11-30T06:44:22.237+00:00

Is it possible that MS Graph List User API returns users with empty or null userPrincipalName? And what would be the cases if so?

Microsoft Teams Development
Microsoft Security Microsoft Entra Microsoft Entra ID
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,371 Reputation points
    2022-11-30T10:03:30.633+00:00

    Hi @Scott Jiang

    No!

    This property is required when you create a user, and it does not return a null value.

    265706-image.png


    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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nivedipa-MSFT 3,646 Reputation points Microsoft External Staff Moderator
    2022-11-30T10:22:05.81+00:00

    It's not possible that MS Graph List User API returns users with empty or null userPrincipalName.
    userPrincipalName is required property for user.

    We have tried to create user without userPrincipalName but its showing error.

    265708-image.png

    Thanks,
    Nivedipa


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    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.