How to Get the list of user's profile pictures from Microsoft Graph using powershell

Mepani Arvindkumar Vishram 1 Reputation point
2021-03-26T10:37:40.463+00:00

How to Get the list of user's profile pictures from Microsoft Graph using PowerShell?

I want to download the User's profile pictures from MS Graph, Azure AD, and Delve.

Is there a way or Powershell script available?

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

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,741 Reputation points Microsoft Employee
    2021-03-29T12:20:06.007+00:00

    Microsoft Graph PowerShell SDK would be a good place to start. Since it is not possible to get list of user profile picture, you may have to get the users list then perform the Get-MgUserPhoto -UserId user_id operation for each of them

    >$users = Get-MgUser  
    >for($i = 0; $i -lt $users.length; $i++){ Get-MgUserPhotoContent -UserId $users[$i].id }  
    
    1 person found this answer helpful.
    0 comments No comments