How to get a Microsoft Entra ID contact's thumbnail photo using Microsoft Graph PowerShell

Contacts in Microsoft Entra ID represent external individuals that your organization interacts with. Having identification like a thumbnail photo can help admins validate contacts and ensure accurate records. This can be accomplished by running the Get-MgUserContactPhoto cmdlet in Microsoft Graph PowerShell.

Retrieving the thumbnail using Microsoft Graph PowerShell

Prerequisites

Before using the Get-MgUserContactPhoto cmdlet, ensure the following:

  • If the Microsoft Graph PowerShell module is not installed, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the following permission to retrieve the thumbnail of a contact:
    ProfilePhoto.Read.All

Retrieving the thumbnail using the Get-MgUserContactPhoto cmdlet

Run the following commands in Microsoft Graph PowerShell to retrieve the thumbnail photo of a contact:

Get-MgUserContactPhoto
-ContactId <String>
-UserId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]

Supported parameters

The following table contains some parameters that can be used along with the Get-MgUserContactPhoto cmdlet to retrieve a contact's thumbnail photo.

Parameters Description
-ContactID The unique identifier of a contact.
-UserID The unique identifier of a user.
-ExpandProperty Expands related entities.
-Property Selects properties to be returned.
-ResponseHeadersVariable Captures HTMP response headers into a variable.
-Headers Optional headers that will be added to the request.

Limitations of using Microsoft Graph PowerShell to retrieve a contact's thumbnail photo

  • Scripts require strong technical prowess, and admins often spend a lot of time honing their skills and debugging errors.
  • Even an insignificant error, such as a missed colon or space, could lead to a series of errors.
  • Sufficient permissions are required in Microsoft Entra ID to execute certain scripts.

How ADManager Plus helps you manage Microsoft Entra ID

ADManager Plus, an identity governance and administration solution with comprehensive Microsoft Entra ID management and reporting capabilities, simplifies complex admin tasks from a single, user-friendly console:

  • Manage your Active Directory (AD), Microsoft Entra ID, and Google Workspace environments from a single, user-friendly console.
  • Automate and orchestrate user provisioning, deprovisioning, license management, and many other administrative tasks across various platforms.
  • Delegate administrative tasks to technicians without elevating their native privileges.
  • Keep tabs on delegated activities with preconfigured reports and smart workflows.
  • Monitor your IT environment with more than 200 prepackaged reports.
  • Disaster-proof your organization with AD, Microsoft Entra ID, and Google Workspace backup and recovery.

Perform script-free Microsoft Entra ID management and reporting with ADManager Plus

 
  • Retrieving the thumbnail using Microsoft Graph PowerShell
  • Limitations of using Microsoft Graph PowerShell scripts
  • How ADManager Plus can hep you
The one-stop solution to Active Directory Management and Reporting
Email Download Link