I'm looking for a way to export organisation hierarchy that is stored in our Office365 environment. There is a feature in Outlook / MS teams where you can look at the organisation, but it is very limited and only shows those who report to the same manager, and the levels above and below the person. I.e., its not possible to get a view of the organisation as a whole, only parts of it.
Every employee in our AAD has their manager field and the department field filled. I can export lists of employees and the departments they belong to, but the field "manager" is never filled. I've tried several admin portals to export all users and get the "manager" colums aswell, but that field is not exported when I tried from the AAD-, Exchange-, outlook and the general office365 admin portal*.
I just want to get a neat CSV out with the name of the employee, their department, their closest manager so that I can create a visual org.chart of the organisation as a whole through mermaid or any other scripting language.
*The links that I used for the various portals are:
- admin.exchange.microsoft.com
- https://aad.portal.azure.com
- https://outlook.office365.com/
- https://admin.microsoft.com/