Edit

Share via


Set-EntraBetaUserThumbnailPhoto

Set the thumbnail photo for a user.

Syntax

File (Default)

Set-EntraBetaUserThumbnailPhoto

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

ByteArray

Set-EntraBetaUserThumbnailPhoto

    -ImageByteArray <Byte[]>
    -UserId <String>
    [<CommonParameters>]

Stream

Set-EntraBetaUserThumbnailPhoto

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

Description

The Set-EntraBetaUserThumbnailPhoto 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-EntraBetaUserThumbnailPhoto -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

-FileStream

A filestream that contains the user thumbnail photo.

Parameter properties

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

Parameter sets

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

-ImageByteArray

An Image Byte Array that contains the user thumbnail photo.

Parameter properties

Type:

System.Byte[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ByteArray
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