get active users only

Soumya Ranjan Sahoo 25 Reputation points
2024-02-05T11:59:09.21+00:00
Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,371 Reputation points
    2024-02-06T06:26:25.56+00:00

    Hi @Soumya Ranjan Sahoo

    This is an expected error, because $filter=accountEnabled eq true is an advanced query, and advanced queries do not currently support $expand. You can only split it into two separate requests:

    User's image

    https://graph.microsoft.com/v1.0/groups/{group id}/transitiveMembers/microsoft.graph.user?$count=true&$select=id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,surname,userPrincipalName,department,companyName,streetName,city,state,postalCode,country,faxNumber,jobTitle,mailNickname,accountEnabled&$filter=accountEnabled eq true
    
    ConsistencyLevel: eventual
    

    or

    https://graph.microsoft.com/v1.0/groups/{group id}/transitiveMembers/microsoft.graph.user?$count=true&$select=id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,surname,userPrincipalName,department,companyName,streetName,city,state,postalCode,country,faxNumber,jobTitle,mailNickname,accountEnabled&$expand=manager($select=id,displayName,mail)
    

    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.


0 additional answers

Sort by: Most helpful

Your answer

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