【发布时间】:2020-09-24 10:12:52
【问题描述】:
我是从 Azure Active Directory 检索用户的 Microsoft Graph API/SDK。我的 Filter() 函数给我错误消息:为资源 'User' 的属性 'userType' 指定了不受支持或无效的查询过滤器子句。
我的代码是:
var azureUsers = await graphClient
.Users
.Request().Filter("startsWith(userType, 'P')")
.Select(x => new
{
x.Id,
x.UserType,
x.DisplayName,
x.GivenName,
x.Surname,
x.UserPrincipalName,
x.AccountEnabled,
x.Identities,
x.BusinessPhones,
x.JobTitle,
x.MobilePhone,
x.OfficeLocation,
x.PreferredLanguage,
x.Mail,
x.Extensions,
x.CreatedDateTime
})
.GetAsync();
它完全适用于
.Filter("startsWith(mail, 'P')")
但与用户类型无关。
我的 Azure AD 中有这个属性 UserType
我们的访客用户大约有 700 人,我想在通话中排除他们。
它给了我正确的价值
x.UserType,
但我想在通话中过滤这个。任何帮助将不胜感激。
【问题讨论】:
标签: c# asp.net-mvc azure-active-directory microsoft-graph-api microsoft-graph-sdks