Hi @Wendy Wang,
Thanks for reaching out.
Using the MS Graph API: GET /users/{id | userPrincipalName}/photo/$value you can get the photo of other user. Please refer the link for more details: Get profile Photo.
Refer the link to know about the permission required to execute this Graph API endpoints.
Please note:
· Metadata operation is not supported for personal Microsoft accounts.
· There is currently a known issue with accessing group photos using application permissions.
· Retrieving a user's photo using the Microsoft Graph API is currently not supported in Azure AD B2C tenants.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.