如何使用 Get-MgUserLicenseDetail 获取 Microsoft Entra ID 中用户的许可证详细信息

获取 Microsoft Entra ID 中用户的许可证详细信息

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

  • ADManager Plus
  • PowerShell
 

使用 ADManager Plus 查找 Microsoft Entra ID 中用户的许可证详细信息

  1. 登录 ADManager Plus 并导航至 Microsoft 365 > Reports > License Reports
  2. General License Reports 下,点击 Licensed Users
  3. Microsoft 365 租户 下拉列表中选择所需的 Microsoft 365 租户。
  4. Filter By 弹出窗口中选择您想要获取用户的目标组或域,然后点击 Generate Now
  5. 通过点击 Details (位于 License Details 列下)可以查看用户的许可证详细信息。
使用 ADManager Plus 预定义报告获取 Microsoft Entra ID 中用户的许可证详细信息
 
 

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

 
 

安排自动生成报告。

 
 

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

使用 Microsoft Graph PowerShell 获取 Microsoft Entra ID 中用户的许可证详细信息

前提条件

在使用 Get-MgUserLicenseDetail 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 fetch a user's license details in Microsoft Entra ID with this script:
    Connect-MgGraph -Scopes "User.Read.All"

使用 Get-MgUserLicenseDetail 命令获取 Microsoft Entra ID 中用户的许可证详细信息

Get-MgUserLicenseDetail cmdlet 可用于 Microsoft Graph PowerShell 中获取 Microsoft Entra ID 中用户的许可证详细信息。语法如下:

Get-EntraUserLicenseDetail
-UserId <String>
[-Property <String[]>]
[<CommonParameters>]

使用 Get-MgUserLicenseDetail cmdlet 的示例用例

列出特定用户的许可证详细信息

Get-MgUserLicenseDetail -UserId <'user_id'>

在此命令中,将 user_id 替换为您想查看许可证详细信息的用户 ID。

支持的参数

下表包含一些可与 Get-MgUserLicenseDetail 命令一起使用的参数,以高效获取 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 中用户许可证详细信息的亮点

  • 直观的界面简化报告生成流程。
  • 提供全面且可自定义的报告,支持计划和自动生成报告。
  • 支持即时执行管理操作以 manage users
  • 针对大规模环境优化,无需任何脚本即可进行批量操作。
  • Delegate tasks 给技术人员,无需提升其本地权限。
  • 通过超过 200 pre-packaged reports 密切监控您的 IT 环境。
  • 只需几次点击即可将报告导出为 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