Over the years I have been asked this question several times. “How can I export my Active Directory data or SharePoint data into a Visio-like org chart”. Look no further……We can leverage SharePoint and PowerShell to get at this data and export it in a format that is “Visio Friendly”.
SharePoint has a service application called the User Profile Service Application (UPSA). One of the primary features of the UPSA is to sync data from Active Directory. By default, when you setup a synchronization it pulls the Active Directory Manager field into a SharePoint user property also named Manager. We can use PowerShell to get that data and export it from SharePoint.
Note: PowerShell cmdlets are available with the Active Directory module that will allow you export directly from AD if needed.
Important: This script will only export user objects that have a manager defined. If there is no value in AD this script will not export the user.