I want to do filtering by identities also by creationType how to do that.

Vazgen Tadevosyan 0 Reputation points
2023-06-15T15:46:29.1333333+00:00

Once I am deleting and creationType eq 'LocalAccount' the rest works fine also once I am deleting identities/any(id:id/issuerAssignedId eq '******@M365x214355.onmicrosoft.com' and id/issuer eq 'M365x214355.onmicrosoft.com') and the other part works fine.
how to do that this works with both filters identities/any(id:id/issuerAssignedId eq '******@M365x214355.onmicrosoft.com' and id/issuer eq 'M365x214355.onmicrosoft.com') and creationType eq 'LocalAccount' User's image

Microsoft Security | Microsoft Graph
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} votes

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,406 Reputation points
    2023-06-16T09:23:39.66+00:00

    Hi @Vazgen Tadevosyan

    Based on my testing, it seems that both properties cannot be filtered at the same time. Not sure if this is by design, you can submit a feature request form for this.

    The currently feasible solution is to get the user set, and then filter in the code. Refer to my sample code, I tested it locally and it works fine:

    var result = await graphClient.Users.GetAsync((request) => {
        request.QueryParameters.Filter = $"identities/any(id:id/issuerAssignedId eq 'xxxxxxxxxxxx' and id/issuer eq 'xxxxxxxxxxxxxxx')";
        }
       );
    
    
    for (int i = 0; i < result.Value.Count; i++) {
    
       if (result.Value[i].CreationType == "LocalAccount") {
    
            Console.WriteLine(JsonConvert.SerializeObject(result.Value[i]));
    
       }
    
    }
    

    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.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.