Finding the user photo properties in Microsoft Entra ID can help admins ensure that profile images are properly configured and comply with organizational standards. Verifying photo properties can also help maintain a consistent user experience across applications and services within the enterprise.
Before using the Get-MgUserPhoto cmdlet, ensure the following:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "User.Read.All","Group.ReadWrite.All","Directory.Read.All"
The Get-MgUserPhoto cmdlet can be used in Microsoft Graph PowerShell to fetch Microsoft Entra ID user photo properties. Here's the syntax:
Get-MgUserPhoto
-UserId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]
Listing the photo properties of a particular user
Get-MgUserPhoto -UserId <"user_id">
In this command, replace user_id with the user's ID for whom you would like to list the user photo properties.
The following table contains some parameters that can be used along with the Get-MgUserPhoto command to fetch Microsoft Entra ID user photo properties.
| Parameters | Description |
|---|---|
| -All | This parameter retrieves all user photo properties without default pagination limits. |
| -UserId | This parameter retrieves user photo properties based on their unique identifiers, such as user principal name or object ID. |
| -Property | This parameter retrieves specific attributes of user photo properties. |