You need to enable JavaScript to run this app. 是否可以使用KQL获取Azure AD用户的相关信息?
优惠活动
大模型
产品
解决方案
定价
更多

是否可以使用KQL获取Azure AD用户的相关信息?

可行实现方案如下

方案1:查询全量Azure AD用户静态属性

通过Azure Resource Graph(ARG)的KQL能力实现,ARG内置的IdentityResources表包含所有Azure AD用户的基础属性,适合需要拉取全量用户信息的场景:

  • 你可以直接在Azure门户的Resource Graph Explorer中运行以下查询语句:
IdentityResources
| where type == 'microsoft.azureactivedirectory/users'
| project 
    DisplayName = properties.displayName,
    UserPrincipalName = properties.userPrincipalName,
    ObjectId = id,
    AccountEnabled = properties.accountEnabled,
    Mail = properties.mail,
    Department = properties.department
  • 前置要求:你需要拥有Azure AD用户读取权限、Azure Resource Graph查询权限。

方案2:关联操作日志查询用户属性

如果你需要的是和用户登录、操作行为关联的用户属性,可以直接查询存储在Log Analytics工作区的Azure AD日志,适合需要结合行为数据查询用户信息的场景:

  • 示例:查询最近7天有登录记录的用户信息
SigninLogs
| where TimeGenerated >= ago(7d)
| distinct 
    DisplayName,
    UserPrincipalName,
    UserId,
    AppDisplayName,
    ClientAppUsed
  • 注意:该方案仅能查询到产生过对应日志的用户数据,不会返回全量Azure AD用户。

内容的提问来源于stack exchange,提问作者AMA

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.16 08:36:05