I am Microsoft Graph API/SDK to retrieve users from Azure Active Directory. My Filter() function giving me error Message: Unsupported or invalid query filter clause specified for property 'userType' of resource 'User'.
My code is:
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();
It works absolutely fine with
.Filter("startsWith(mail, 'P')")
But not with the user type.
I have this attribute UserType in my Azure AD
Our guest users are around 700 and I want to exclude them in call.
It's giving me correct values with
x.UserType,
But I want to filter this in Call. Any help would be much appreciated.
