如何在MS Graph API中组合NOT过滤器

时间:2018-03-09 16:07:33

标签: c# microsoft-graph

我想搜索图形API用户的名字以某个值开头的每个人

我试过

DateValue(dateVar)

但是我得到了

  

无效的过滤条款

有没有办法实现这个目标?

我实际上需要在C#中执行此操作,我遇到同样的问题 - 我想知道是否有使用SDK指定https://graph.microsoft.com/v1.0/users?$filter="NOT startswith(displayName,'J')" https://graph.microsoft.com/v1.0/users?$filter=not(startswith(displayName,'J')) 的方法?

NOT STARTSWITH

2 个答案:

答案 0 :(得分:1)

我担心users(或任何其他Azure AD资源)不支持此类过滤器。来自documentation

  

Azure AD资源不支持以下$filter运算符:negtgeltlenot

答案 1 :(得分:1)

它不是用户,但我设法通过 not startsWith 获取数据,如下所示:

client.DeviceManagement.ManagedDevices.Request().Filter("not startsWith(operatingSystem, 'Windows')").GetAsync()