【问题标题】:Azure Graph - Retrieve user by ImmutableId - Filter issueAzure Graph - 通过 ImmutableId 检索用户 - 筛选问题
【发布时间】:2021-02-10 01:43:17
【问题描述】:

我正在尝试使用不可变 ID 查找 Azure 用户,但它不起作用。 手动查找 Azure 用户,我可以看到不可变 id 已填充(实际属性名称为“immutableId”),并且与我要查询的内容相匹配。

实际上,我无法使用任何过滤器检索任何用户,例如: https://graph.windows.net/{tenant}/users?&api-version={version}?$filter=startswith(displayName,'{startofuid}')

不同的测试uri:

https://graph.windows.net/{tenant}/users?&api-version={version}?$filter=immutableIdeq '{id}'

https://graph.windows.net/{tenant}/users?&api-version={version}?$filter=immutableId+eq+'{id}'

https://graph.windows.net/{tenant}/users?&api-version={version}?$filter=startswith(immutableId,'{id}')

https://graph.windows.net/{tenant}/users?&api-version={version}?$filter=startswith(immutableId%2C+'{id}')

正常的资源查找工作:

https://graph.windows.net/{tenant}/users/{azureguid}?&api-version={version}

有什么想法可能是错的吗?

【问题讨论】:

  • 尝试使用:https://graph.microsoft.com/v1.0/users?$filter=onPremisesImmutableId+eq+'{id}'

标签: api graph azure-active-directory


【解决方案1】:

从 2020 年 6 月 30 日开始,微软将正式不再向 Azure AD Graph API 添加任何新功能。建议您升级应用程序以使用 Microsoft Graph API 而不是 Azure AD Graph API 来访问 Azure Active Directory 资源。

您可以使用 onPremisesImmutableId 属性来检索用户。然后使用graph-explorer 工具进行测试,不要忘记为您的 api 授予权限。

【讨论】:

  • 感谢您的精彩评论。一个有点相关的问题,我也想对组做同样的事情,但似乎 immutableid 并没有被 api 检索到。我可以看到属性 onpremisesamaccountname 正在查找组,但我无法使用 Azure Graph 或 Microsoft Graph 对其进行过滤
【解决方案2】:
【解决方案3】:

Get-AzureADUser -Filter "immutableid eq 'ABCD'"

【讨论】:

  • 欢迎来到 SO。请您编辑您的答案以包含更多信息。
猜你喜欢
  • 2022-01-01
  • 2021-09-02
  • 1970-01-01
  • 1970-01-01
  • 2015-12-20
  • 1970-01-01
  • 2021-03-06
  • 1970-01-01
  • 2013-06-17
相关资源
最近更新 更多