如何通过ProxyAddresses在B2C中查找用户?

问题描述 投票:0回答:1

我正在尝试在 azure B2C 中注册用户,但我不能,因为另一个具有 ProxyAddresses 属性的对象已经存在。问题是,当我尝试查找该用户时,它不存在。有没有办法找出这个代理地址分配给哪个用户?

azure-ad-b2c azure-ad-b2c-custom-policy aad-b2c
1个回答
0
投票

要通过 proxyAddresses 在 B2C 中查找用户,您可以使用以下 Microsoft Graph API 调用:

GET https://graph.microsoft.com/beta/users?$filter=proxyAddresses/any(x:x+eq+'SMTP:{email}')

就我而言,我通过在 B2C 用户同意 User.Read.All 权限的情况下登录,在

Graph Explorer
中运行以下查询,并获得如下响应

GET https://graph.microsoft.com/beta/users?$filter=proxyAddresses/any(x:x+eq+'SMTP:[email protected]')&$select=id,displayName,proxyAddresses

回复:

enter image description here

您可以通过运行以下 MS Graph PowerShell 命令获得相同的结果

Connect-MgGraph -Scope "User.Read.All"

Import-Module Microsoft.Graph.Beta.Users
Get-MgBetaUser -Filter  "proxyAddresses/any(x:x eq 'SMTP:[email protected]')" -Property "id,displayName,proxyAddresses"

回复:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.