Change user profile photos

Check out Microsoft 365 small business help on YouTube.

This article explains how to manage profile photos on user accounts and Microsoft 365 Groups.

Tip

If you need help with the steps in this article, consider working with a Microsoft small business specialist. With Business Assist, you and your employees get around-the-clock access to small business specialists as you grow your business, from onboarding to everyday use.

Before you begin

You must be a global admin to complete these steps.

You can't remove existing user photos using the Microsoft 365 admin center. You can only use Microsoft Graph PowerShell.

You can't manage user photos for Microsoft 365 Groups using the Microsoft 365 admin center. You can only use Microsoft Graph PowerShell.

The maximum supported size of a photo is 4 MB.

Use the Microsoft 365 admin center to change a user's profile photo

  1. In the Microsoft 365 admin center, go to the Users > Active users page.

  2. On the Active users page, select the user by clicking anywhere in the row other than the check box. In the details flyout that opens, select Change photo under their existing photo placeholder or photo at the top of the flyout.

    The Change user action in the properties of the user account in the Microsoft 365 admin center.

  3. In the Change photo flyout that opens, select Choose photo.

  4. In the File upload dialog that opens, find and select the photo, and then select Open.

  5. Back on the Change photo flyout, select Save changes, and then select Back to return to the details flyout, or Close to return to the Active users page

Tip

In the user details flyout or the Change photo flyout, you can download an existing photo by right-clicking on the photo and selecting Save image as.

Manage user photos in Microsoft Graph PowerShell

After you install the Microsoft Graph PowerShell SDK, use the Connect-MgGraph cmdlet to sign in with the required scopes. You need to sign in with an admin account to consent to the required scopes.

  • Users only:

    Connect-MgGraph -Scopes "User.ReadWrite.All"
    
  • Microsoft 365 Groups only:

    Connect-MgGraph -Scopes "Group.ReadWrite.All"
    
  • Users and Microsoft 365 groups:

    Connect-MgGraph -Scopes "User.ReadWrite.All","Group.ReadWrite.All"
    

Add user photos in Microsoft Graph PowerShell

  • Users:

    Set-MgUserPhotoContent -UserId <UPN> -InFile "<PhotoPathAndFileName>"
    

    For example:

    Set-MgUserPhotoContent -UserId albertas@contoso.onmicrosoft.com -InFile "C:\Upload\Alberta Sanchez.png"
    

    For detailed syntax and parameter information, see Set-MgUserPhotoContent.

  • Microsoft 365 Groups:

    Set-MgGroupPhotoContent -GroupId <ID> -InFile "<PhotoPathAndFileName>"
    

    You get the ID GUID value of the Microsoft 365 Group from the output of a Get-MgGroup command.

    For example:

    Set-MgGroupPhotoContent -GroupId 173cd812-5563-439c-9da4-bc2715fa2aee -InFile "C:\Upload\Sales Department.png"
    

    For detailed syntax and parameter information, see Set-MgGroupPhotoContent.

Get information about user photos in Microsoft Graph PowerShell

The commands return the following information about the existing photo:

  • Id: The value is Default.
  • Height: In pixels.
  • Width: In pixels.

If the user has no photo, the commands return the error: Exception of type 'Microsoft.Fast.Profile.Core.Exception.ImageNotFoundException' was thrown..

  • Users:

    Get-MgUserPhoto -UserId <UPN>
    

    For example:

    Get-MgUserPhoto -UserId albertas@contoso.onmicrosoft.com
    

    For detailed syntax and parameter information, see Get-MgUserPhoto.

  • Microsoft 365 Groups:

    Get-MgGroupPhoto -GroupId <ID>
    

    You get the ID GUID value of the Microsoft 365 Group from the output of a Get-MgGroup command.

    For example:

    Get-MgGroupPhoto -GroupId 173cd812-5563-439c-9da4-bc2715fa2aee
    

    For detailed syntax and parameter information, see Get-MgGroupPhoto.

Download user photos in Microsoft Graph PowerShell

  • Users:

    Get-MgUserPhotoContent -UserId <UPN> -OutFile "<PhotoPathAndFileName>
    

    For example:

    Get-MgUserPhotoContent -UserId albertas@contoso.onmicrosoft.com -OutFile "C:\Download\Alberta Sanchez.png"
    

    For detailed syntax and parameter information, see Get-MgUserPhotoContent.

  • Microsoft 365 Groups:

    Get-MgGroupPhotoContent -GroupId <ID> -OutFile "<PhotoPathAndFileName>
    

    You get the ID GUID value of the Microsoft 365 Group from the output of a Get-MgGroup command.

    For example:

    Get-MgGroupPhotoContent -GroupId 173cd812-5563-439c-9da4-bc2715fa2aee -OutFile "C:\Download\Sales Department.png"
    

    For detailed syntax and parameter information, see Get-MgGroupPhotoContent.

Remove user photos in Microsoft Graph PowerShell

  • Users:

    Remove-MgUserPhoto -UserId <UPN>
    

    For example:

    Remove-MgUserPhoto -UserId albertas@contoso.onmicrosoft.com
    

    For detailed syntax and parameter information, see Remove-MgUserPhoto.

  • Microsoft 365 Groups:

    Remove-MgGroupPhoto -GroupId <ID>
    

    You get the ID GUID value of the Microsoft 365 Group from the output of a Get-MgGroup command.

    For example:

    Remove-MgGroupPhoto -GroupId 173cd812-5563-439c-9da4-bc2715fa2aee
    

    For detailed syntax and parameter information, see Remove-MgGroupPhoto.