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