Microsoft Graph AD Users或people API可以搜索所有用户? [英] Microsoft Graph AD Users or people API to search all users?

查看:137
本文介绍了Microsoft Graph AD Users或people API可以搜索所有用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序内置功能,以便管理员"将其广告组中的用户分配给某些组,这些组进一步分配给应用程序特定的角色.基本上是一个简单的管理组件.

I'm trying to build functionality into my app for 'admins' to assign users from their AD group to certain groups that are further assigned to app-specific roles. Basically a simple management component.

将带有oid的用户添加到组很容易,我面临的问题是找到实际用户.

Adding the user with the oid to a group is easy, the problem I'm facing is finding the actual user.

目前,我看到的唯一选择是向v1.0/用户发出多个api请求(最多999个项目)并将它们全部分组到内存中,然后提供简单的搜索功能来缩小范围.

Currently, the only option I'm seeing is making multiple api requests to v1.0/users (999 items max) and grouping them all in memory and then provide a simple search function to narrow it down.

我还使用了v1.0/me/people端点来搜索用户,但这并不能显示AD组中的所有用户,只是他们所处理的相关用户,因此不太有用.

I have also used the v1.0/me/people endpoint to search for users but this does not reveal all users from the AD group, just relevant users they deal with, so not too useful.

我是否可以使用其他任何api端点仅对同一活动目录的成员进行搜索?

Is there any other api endpoint I could tap into to do a search ONLY on members of the same active directory?

推荐答案

在多个属性上使用startsWith过滤器可能是目前我们在MS Graph中与用户搜索最接近的方法:

Using the startsWith filter on multiple properties is probably the closest we can get to user search in MS Graph at the moment:

https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'sarah')或startswith(givenName,'sarah')或startswith(surname,'sarah')或startswith(mail,'sarah')或startswith(userPrincipalName,'sarah')

这篇关于Microsoft Graph AD Users或people API可以搜索所有用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆