Can I get all profilephoto of all users inorganization along with user data in single query from Azure AD?

Dev 106 Reputation points
2021-03-26T06:13:27.763+00:00

I am trying to retrieve all the users from the organisation which is working fine but I need to get the profile picture object as well along with the information of the user.
So I need to call api again for every user in order to get the profile picture or is there a way to get profilePhoto in the same "/users" get methods.

Thanks in advance

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,207 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,726 Reputation points Microsoft Employee
    2021-03-31T08:46:12.157+00:00

    Graph has no single endpoint to return all user profile photos. You have to call Get Profile Photo for each user.
    So for any list of users, the profile photo can be constructed using https://graph.microsoft.com/v1.0/users/{user-id}/photo/$value

    1 person found this answer helpful.