Azure AD B2C does not support advanced queries, this is a known issue, so don't try to filter using the advanced query feature of the $filter
query parameter.
The currently available method is to filter the user set using the graph C# SDK, please refer to my code snippet:
try
{
var result = await graphServiceClient.Users.GetAsync();
var userList = result.Value;
for (int i = 0; i < userList.Count; i++) {
if (userList[i].State == null) {
var user = new Dictionary<string, object>();
user.Add("id", userList[i].Id);
user.Add("displayName", userList[i].DisplayName);
user.Add("state", userList[i].State);
Console.WriteLine(JsonConvert.SerializeObject(user));
}
}
}
catch (ODataError odataError)
{
Console.WriteLine(odataError.Error.Code);
Console.WriteLine(odataError.Error.Message);
}
Hope this helps. If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.