本文介绍了如何通过 userType = null 过滤用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am trying to filter out Guest users in my Graph query. Since the ne comparison operator is not supported I was trying $filter=userType eq 'Member' or userType eq null instead. That fails too though. Any known workarounds to list users with null as userType?

Without that I need to download about a million rows each time and throw 4 out of 5 away on the client side, which is pretty slow and wasteful.

{
"error": {
    "code": "Request_UnsupportedQuery",
    "message": "Unsupported or invalid query filter clause specified for property 'userType' of resource 'User'.",
    "innerError": {
        "request-id": "411f7927-c3af-4042-a619-eee1c88971a0",
        "date": "2018-03-17T18:28:35"
    }
}
解决方案

Update as of June 2021

the ne comparison operator is now supported on userType on graph! So you can now get users that are not guest users with this query: https://graph.microsoft.com/v1.0/users/$count?$filter=userType ne 'guest'

here is a link to graph explorer with that query

这篇关于如何通过 userType = null 过滤用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 23:46