question

anomepani avatar image
0 Votes"
anomepani asked Danstan-MSFT edited

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

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-profile
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Danstan-MSFT avatar image
1 Vote"
Danstan-MSFT answered Danstan-MSFT edited

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 }




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.