admin管理员组文章数量:1402291
I'm working on a desktop application which accesses EntraID via the c# Graph API SDK.
The application monitors users logged into the device. Logged in user accounts are received as 'AzureAD\UserName'.
So for a logged in user account, 'AzureAD\JohnSmith' What I want to do is find the corresponding User entity 'John Smith' in Entra ID.
I guess what is needed is an Entra user attribute/property which holds the AzureAD account name 'Azuread\JohnSmith' and use this to query Entra via the Graph API.
I've searched the Entra Admin Centre, but cannot find an attribute which holds the AzureAD account name for any users in my test tenant.
Microsoft obviously do this mapping of AzureAD Account to Entra User entity internally, so I am hoping there is a way to do this.
I'd be grateful for any pointers or suggestions.
Thanks John
I'm working on a desktop application which accesses EntraID via the c# Graph API SDK.
The application monitors users logged into the device. Logged in user accounts are received as 'AzureAD\UserName'.
So for a logged in user account, 'AzureAD\JohnSmith' What I want to do is find the corresponding User entity 'John Smith' in Entra ID.
I guess what is needed is an Entra user attribute/property which holds the AzureAD account name 'Azuread\JohnSmith' and use this to query Entra via the Graph API.
I've searched the Entra Admin Centre, but cannot find an attribute which holds the AzureAD account name for any users in my test tenant.
Microsoft obviously do this mapping of AzureAD Account to Entra User entity internally, so I am hoping there is a way to do this.
I'd be grateful for any pointers or suggestions.
Thanks John
Share Improve this question asked Mar 21 at 12:59 JohnK88JohnK88 1 2 |1 Answer
Reset to default 0Note: Using Microsoft Graph API, you cannot directly call AzureAD\JohnSmith
- To map a local
AzureAD\JohnSmith
account to an Entra ID user, you can query Entra ID using the UserPrincipalName (UPN), in the format[email protected]
. Use the Microsoft Graph API to find the user by UPN:
var result = await graphClient.Users["{user-id}"].GetAsync();
If necessary, check the OnPremisesSamAccountName
for on-premises sync scenarios using Microsoft Graph API.
GET https://graph.microsoft/v1.0/users/[email protected]
Reference:
Get user - Microsoft Graph v1.0 | Microsoft Learn
本文标签: azure active directoryFind User Entity in Entra ID from AzureAD account nameStack Overflow
版权声明:本文标题:azure active directory - Find User Entity in Entra ID from AzureAD account name - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744351921a2602102.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
AzureAD\JohnSmith
account to an Entra ID user, you can query Entra ID using the UserPrincipalName (UPN), typically in the format[email protected]
. Use the Microsoft Graph API to find the user by UPN:var user = await graphClient.Users["[email protected]"].GetAsync();
If necessary, check theOnPremisesSamAccountName
for on-premises sync scenarios. – Rukmini Commented Mar 24 at 7:31