Is there a way to export Users and their corresponding Managers?

Anthony Chang 0 Reputation points
2025-09-30T20:56:10.5533333+00:00

I need to export a list of Users and their corresponding Managers but it doesn't seem like there's a streamline way to do this. After digging into this a bit further I've only seen powershell scripts passed around the forums. Just posting this to see if anyone has another way of doing it or if scripting is the only way currently.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} votes

2 answers

Sort by: Most helpful
  1. Alex Burlachenko 18,310 Reputation points Volunteer Moderator
    2025-10-01T10:06:50.57+00:00

    Hi Anthony ,

    you are right, the azure portal ui does not have a simple 'export users and managers' button. for this specific data relationship, scripting is indeed the most reliable and direct method.

    the microsoft graph api is your best friend here. you can use a simple powershell script with the microsoft.graph module to get this data cleanly.

    review that basic outline of the script.

    connect-mggraph -scopes 'user.read.all' get-mguser -all -property 'displayname', 'userprincipalname', 'mail', @{n='manager';e={get-mgusermanager -userid $.id -property 'displayname'}} | select-object displayname, userprincipalname, mail, @{n='manager';e={$.manager.additionalproperties.displayname}} | export-csv -path 'c:\temp\users_with_managers.csv' -notypeinformation

    this script connects to microsoft graph, fetches all users with their display name and email, and for each user, it makes a separate call to get their manager's display name. finally, it exports everything to a csv file.

    if you are not comfortable with powershell, you can also use the microsoft graph explorer tool in your browser. it is a great way to test the api calls. you would need to run two queries, one to list users and another to get each user's manager.

    another option is to use the entra id admin center reporting features. you can go to users > all users and use the columns option to add the 'manager' column. then, you can export the list from the portal. however, this method can be slow for large directories and sometimes the export does not include the manager column reliably.

    for a guaranteed and automated result, a small powershell script using the microsoft graph module is the way to go. for a one time manual export, you can try adding the manager column in the entra id user list and exporting from there.

    regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/


  2. Shree Hima Bindu Maganti 5,805 Reputation points Microsoft External Staff Moderator
    2025-10-23T16:42:36.8033333+00:00

    Hi @Anthony Chang
    If you need to export a list of users and their managers from Azure or a similar environment, scripting is often a good solution, but there are other options depending on where your users are located.

    You can download a user list, which may include manager details if that information is set.

    Sign in to the Microsoft Entra admin center.

    Go to Microsoft Entra ID > Users > All users.

    Select Download users to get a CSV file with user information.

    Make sure manager info is included in user profiles for it to show up in the export.

    PowerShell is commonly used to export user and manager data in Azure. You can use a script to pull this information.

    Get-AzureADUser -All $true | Select-Object DisplayName, UserPrincipalName, @{Name="Manager";Expression={(Get-AzureADUserManager -ObjectId $_.ObjectId).DisplayName}} | Export-Csv -Path "UsersWithManagers.csv" -NoTypeInformation
    

    If you’re working with Azure DevOps, you can export user lists, which may show access levels and, depending on your setup, managerial relationships.

    Go to Organization settings > Users > Export users to download the list.

    Let me know if you need more details or help

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.