Edit

Share via


Set-EntraUserThumbnailPhoto

Set the thumbnail photo for a user.

Syntax

File (Default)

Set-EntraUserThumbnailPhoto

    -UserId <String>
    -FilePath <String>
    [<CommonParameters>]

Stream

Set-EntraUserThumbnailPhoto

    -FileStream <Stream>
    -UserId <String>
    [<CommonParameters>]

ByteArray

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'
Set-EntraUserThumbnailPhoto -UserId 'SawyerM@contoso.com' -FilePath 'D:\UserThumbnailPhoto.jpg'

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.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

File
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-UserId

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

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId, UPN, Identity, UserPrincipalName

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

System.IO.Stream System.Byte[]

Outputs

System.Object