![](/img/trans.png)
[英]Get list of all users with the id of group in which user is member using azure graph api
[英]Get list of users under a user using Azure graph API
我正在尋找實現如下方法:
如果我將經理 ID 傳遞給我的方法,那么它需要向我提供向該經理報告的用戶列表。
我可以在哪里找到參考,如果我提供用戶 ID,它會為我提供用戶向其報告的經理。
https://docs.microsoft.com/en-us/previous-versions/azure/ad/graph/api/users-operations
但我需要反過來。 例如,我提供了經理 ID,我需要該經理下的用戶列表。
在此處安裝 Microsoft Graph .NET SDK。
使用客戶端憑據提供程序生成 authProvider。
代碼示例:
IConfidentialClientApplication confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantID)
.WithClientSecret(clientSecret)
.Build();
ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var directReports = await graphClient.Users["{upn or user_object_id}"].DirectReports
.Request()
.GetAsync();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.