4

I'm currently developing an application that uses an Azure AD instance. I'm trying to query this AD to sync the users to my system. I want to retrieve all the users and their groups. The Microsoft Graph API has the following function for this operation:

https://graph.microsoft.com/v1.0/users?$expand=memberOf

However, this gives me the same response as calling: https://graph.microsoft.com/v1.0/users. Users in my AD do have groups and I did try calling the api with $select instead of $expand, but also without result.

Is this a bug? Am I doing something wrong?

Thanks!

koelkastfilosoof
  • 2,212
  • 1
  • 18
  • 28
  • You say "gives me the same response", can you share the response you receive? Is the response an error message? – lukkea Sep 20 '16 at 14:07
  • The response is the list of users. With the `$expand=memberOf` I expect to have a list of groups for that user, but I'm not seeing that. – koelkastfilosoof Sep 20 '16 at 14:19

1 Answers1

4

Expanding navigation properties on user entities is currently not working on the production (v1.0). Please see this post for more information: https://stackoverflow.com/a/39022980.

Community
  • 1
  • 1
David
  • 2,412
  • 1
  • 14
  • 22
  • Right, thanks! I tried getting the groups and $expand their members, and I only want to $select the ID's of those users, but that doesn't seem to work as well. Any info on that? `v1.0/groups?$expand=members($select=id)` – koelkastfilosoof Sep 20 '16 at 17:57
  • I was trying the same thing, it looks like $expand in combination with $select does not work.. at least for me. When I use the $select the $expand stops working – Flores Dec 04 '16 at 14:37
  • On beta it is not working right either. If you try to expand a single navigation property, it expands everything both for the entity itself, and all child entities – Marmoy Aug 02 '17 at 10:55