如何使用 Microsoft Graph PowerShell 获取 Microsoft Entra ID 联系人的缩略图照片

Microsoft Entra ID 中的联系人代表您的组织所互动的外部个人。拥有缩略图照片等身份识别信息可以帮助管理员验证联系人并确保记录准确。可以通过在 Microsoft Graph PowerShell 中运行 Get-MgUserContactPhoto cmdlet 来实现此目的。

使用 Microsoft Graph PowerShell 检索缩略图

前提条件

在使用 Get-MgUserContactPhoto cmdlet 之前,请确保以下事项:

  • 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

使用 Get-MgUserContactPhoto cmdlet 检索缩略图

在 Microsoft Graph PowerShell 中运行以下命令以检索联系人的缩略图照片:

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

支持的参数

下表包含一些可与 Get-MgUserContactPhoto cmdlet 一起使用以检索联系人缩略图照片的参数。

参数 描述
-ContactID 联系人的唯一标识符。
-UserID 用户的唯一标识符。
-ExpandProperty 展开相关实体。
-Property 选择要返回的属性。
-ResponseHeadersVariable 将 HTTP 响应头捕获到变量中。
-Headers 将添加到请求中的可选头。

使用 Microsoft Graph PowerShell 检索联系人缩略图照片的限制

  • 脚本需要较强的技术能力,管理员通常需要花费大量时间提升技能和调试错误。
  • 即使是一个微小的错误,如遗漏冒号或空格,也可能导致一系列错误。
  • 在 Microsoft Entra ID 中执行某些脚本需要足够的权限。

ADManager Plus 如何帮助您管理 Microsoft Entra ID

ADManager Plus 是一款具备全面 Microsoft Entra ID 管理和报告 功能的身份治理与管理解决方案,简化了通过单一用户友好控制台执行的复杂管理任务:

  • 从单一且用户友好的控制台 管理 您的 Active Directory (AD)、Microsoft Entra ID 和 Google Workspace 环境。
  • 自动化 并协调跨多个平台的用户配置、取消配置、许可证管理及其他众多管理任务。
  • 委派管理任务 给技术人员,而无需提升其本地权限。
  • 通过预配置的报告和智能工作流跟踪委派活动。
  • 使用超过 200 个预装报告 监控您的 IT 环境。
  • 通过 AD、Microsoft Entra ID 和 Google Workspace 的备份与恢复,为您的组织构建灾难防护。

使用 ADManager Plus 实现无脚本的 Microsoft Entra ID 管理和报告

 
  • 使用 Microsoft Graph PowerShell 检索缩略图
  • 使用 Microsoft Graph PowerShell 脚本的限制
  • ADManager Plus 如何帮助您
Active Directory管理与报告的一站式解决方案
电子邮件下载链接 Email the ADManager Plus download link