如何使用 Get-MgUserManager 在 Microsoft Entra ID 中查找用户的经理

在 Microsoft Entra ID 中查找用户的经理

IT 管理员经常需要查找用户的经理以满足合规和审计要求。虽然 Graph PowerShell 的 Get-MgUserManager 命令(Get-AzureADUserManager 命令的替代方案)可用于获取并导出 Microsoft Entra ID 中用户的经理详细信息,但其复杂且不直观的界面使其成为一个具有挑战性的选项。另一方面,ADManager Plus 作为一个 Microsoft 365 管理和报告工具,简化了这一过程,使管理员能够仅需几次点击即可快速生成并导出用户的经理详细信息。

  • ADManager Plus
  • PowerShell
 

使用 ADManager Plus 查找 Microsoft Entra ID 中用户的经理

  1. 登录 ADManager Plus 并导航至 Microsoft 365 > Reports > User Reports
  2. General User Reports 下,点击 Microsoft 365 Users
  3. Microsoft 365 租户 下拉列表中选择所需的 Microsoft 365 租户。
  4. Filter By 弹出窗口中选择您想要获取用户的目标组或域,然后点击 Generate Now
  5. 用户的经理信息可在 Manager 列下查看。
使用 ADManager Plus 的预定义报告查找 Microsoft Entra ID 中用户的经理
 
 

以多种格式导出报告,包括 HTML、CSV 和 PDF。

 
 

安排自动生成报告。

 
 

即时分配或撤销 Microsoft 365 许可证。

使用 Microsoft Graph PowerShell 查找 Microsoft Entra ID 中用户的经理

前提条件

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

  • The Microsoft Graph PowerShell module is installed. If not, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the required permissions to find a user's manager in Microsoft Entra ID with this script:
    Connect-MgGraph -Scopes "User.Read.All"

使用 Get-MgUserManager 命令查找 Microsoft Entra ID 中用户的经理

Get-MgUserManager cmdlet 可用于 Microsoft Graph PowerShell 中查找 Microsoft Entra ID 中用户的经理。语法如下:

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

使用 Get-MgUserManager cmdlet 的示例用例

查找特定用户的经理

Get-MgUserManager -UserId <'user_id'>

在此命令中,将 user_id 替换为您想查看经理的用户的 ID。

支持的参数

下表包含一些可与 Get-MgUserManager 命令一起使用的参数,以高效查找 Microsoft Entra ID 中用户的经理。

参数 描述
-UserId 此参数根据用户的唯一标识符(如用户主体名称或对象 ID)检索用户的经理。
-Property 此参数检索用户经理的特定属性。

使用 Graph PowerShell 脚本查找 Microsoft Entra ID 中用户经理的限制

  • Graph PowerShell 要求 IT 管理员从 Azure AD PowerShell 升级并熟悉 PowerShell 脚本。
  • Microsoft Graph API 施加了限制阈值,这可能会影响批量获取用户经理时的性能。
  • 脚本可能需要额外工作来格式化和导出数据以用于报告。
  • 需要技术专长来排查错误。
  • 缺乏直观界面使整体体验不够友好,尤其对脚本新手而言。

使用 ADManager Plus 查找 Microsoft Entra ID 中用户经理的亮点

  • 直观的界面简化报告生成流程。
  • 提供全面且可自定义的报告,支持计划和自动生成报告。
  • 支持即时管理操作,能够即时管理用户。
  • 针对大规模环境优化,无需任何脚本即可进行批量操作。
  • 只需几次点击即可将报告导出为 CSV 或 HTML 等多种格式。

使用 ADManager Plus 轻松查找 Microsoft Entra ID 中用户的经理

 
  • 使用 ADManager Plus 获取 Microsoft Entra ID 中用户的经理
  • 使用 Microsoft Graph PowerShell 查找 Microsoft Entra ID 中用户的经理
  • 使用 Graph PowerShell 脚本获取 Microsoft Entra ID 中用户经理的限制
  • 使用 ADManager Plus 获取 Microsoft Entra ID 中用户经理的亮点
Active Directory管理与报告的一站式解决方案
电子邮件下载链接 Email the ADManager Plus download link