question

sunilmarulasiddaiah-7880 avatar image
0 Votes"
sunilmarulasiddaiah-7880 asked ·

Azure graph API



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

azure-active-directory
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

soumi-MSFT avatar image
0 Votes"
soumi-MSFT answered ·

@sunilmarulasiddaiah-7880, 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://docs.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.




· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@sunilmarulasiddaiah-7880, I wanted to followup and wanted to understand if the above response helped in answering your query. If it did, 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.

0 Votes 0 · ·