I'm trying to register a user in azure B2C, but I can't because another object with the property ProxyAddresses already exists. The problem is that when I try to find this user, it does not exist. Is there a way to find out which user is assigned whit this ProxyAddresses?
To find a user in B2C by proxyAddresses, you can make use of below Microsoft Graph API call:
GET https://graph.microsoft.com/beta/users?$filter=proxyAddresses/any(x:x+eq+'SMTP:{email}')
In my case, I ran below query in Graph Explorer by signing in with B2C user consenting User.Read.All
permission and got response like this:
GET https://graph.microsoft.com/beta/users?$filter=proxyAddresses/any(x:x+eq+'SMTP:[email protected]')&$select=id,displayName,proxyAddresses
Response:
You can get the same results by running below MS Graph PowerShell commands:
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"
Response: