Azure graph API

Sunil A M 171 Reputation points
2020-04-19T04:51:05.037+00:00

Hi

I need help to get data for "MemberOf" column data from the Azure graph API getusers method.

even though i mentioned "MemberOf" in Sleect statement and expand("MemberOf"), I am getting always NULL for that column data.

usersResultPages = Await request.Select("UserType, displayName, givenName, mail, userPrincipalName, surname, OnPremisesDistinguishedName, PreferredLanguage, Country, UsageLocation, OnPremisesDomainName, MemberOf").
Filter("UserType eq 'Member' or UserType eq 'Guest'").
Expand("memberOf").GetAsync()

Help me with example code to get the data for "MemberOf" Column also from azure graph API.

Best Regards,

Sunil

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,473 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. soumi-MSFT 11,716 Reputation points Microsoft Employee
    2020-04-20T08:32:16.627+00:00

    @Sunil A M , When you list the user details using Microsoft Graph API, it doesn't list the memberOf details in that response. hence even if you apply the select filter with memberOf, it would always give you null.

    If you want to list the groups the user is a part of you would have to use the following Microsoft Graph API:

    GET https://graph.microsoft.com/beta/users/**{username/upn}**/memberof

    you can get more details on this here: https://learn.microsoft.com/en-us/graph/api/user-list-memberof?view=graph-rest-1.0&tabs=http

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.