List all managers from EntraId

MIRIAM GRAHAM 40 Reputation points
2024-12-19T17:49:47.7333333+00:00

What would be the Microsoft Graph endpoint to fetch all managers (like in the pictures bellow, all users that are defined as manager)

User's image

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,800 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tristan 80 Reputation points
    2024-12-19T19:57:35.8033333+00:00

    Hi,

    I believe there is no endpoint to find user accounts that are defined as manager of other accounts.

    There are many different ways possible of course, this is an example :

    One of the solutions that can meet your needs (it depends on how many user accounts to request) is to retrieve the list of all your users. Then, for each user, use the Get-MgUserManager command and retrieve the information as follows:

    # Once you get all you users, for each : 
    Get-MgUserManager -UserId $UserId
    $managerUPN = $managerInfo.AdditionalProperties['userPrincipalName']
    $managerDN = $managerInfo.AdditionalProperties['displayName']
    
    #And then store into an array or export in CSV directly
    
    
    
    1 person found this answer helpful.

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.