Nick
Nick

Reputation: 745

List Users that have direct reports in Microsoft Graph

In Microsoft Graph I want to return a list of users who have at least one direct report. It is possible in Azure AD, however I can't find any way to do it on Microsoft Graph.

There is no api endpoint that lists these users, I would have thought that I could access the Users endpoint (https://graph.microsoft.com/v1.0/users/) and apply a Filter, along the lines of "directReports like '*'" but that syntax is invalid, and I can't find any documentation on filtering.

Upvotes: 0

Views: 1912

Answers (1)

Sruthi J
Sruthi J

Reputation: 1602

If you want to get the list of users with directreports, you need to use the below query but this only gives you the directreports array with values present in it or it may be null. You can't further filter it because $expand not support with extra parameters ($filter, $select). Please refer to this document. you need to filter it on your end

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

enter image description here

Upvotes: 1

Related Questions