Set-EntraUserThumbnailPhoto

Set the thumbnail photo for a user.

Syntax

Set-EntraUserThumbnailPhoto
   [-UserId <String>]
   -FilePath <String>
   [<CommonParameters>]
Set-EntraUserThumbnailPhoto
   -FileStream <Stream>
   [-UserId <String>]
   [<CommonParameters>]
Set-EntraUserThumbnailPhoto
   [-UserId <String>]
   -ImageByteArray <Byte[]>
   [<CommonParameters>]

Description

The Set-EntraUserThumbnailPhoto cmdlet is used to set the thumbnail photo for a user.

Updating any user's photo in the organization requires the User.ReadWrite.All permission. Updating only the signed-in user's photo requires the User.ReadWrite permission.

Examples

Example 1: Sets the thumbnail photo

Connect-Entra -Scopes 'User.ReadWrite','User.ReadWrite.All'
$params = @{
    UserId = 'SawyerM@contoso.com'
    FilePath = 'D:\UserThumbnailPhoto.jpg'
}
Set-EntraUserThumbnailPhoto @params

This example sets the thumbnail photo of the user specified with the UserId parameter to the image specified with the FilePath parameter.

  • -UserId parameter specifies the ID of a user in Microsoft Entra ID.
  • -FilePath parameter specifies the file path of the image to be uploaded as the user thumbnail photo.

Parameters

-FilePath

The file path of the image to be uploaded as the user thumbnail photo.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-UserId

The Object ID of the user for which the user thumbnail photo is set.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

System.IO.Stream System.Byte[]

Outputs

System.Object