Hello,
My accounting department has asked for a simple chart that will list the managers and who their direct reports are.
First I used Visio to create a flowchart but it would be much simpler for them to just have a basic text file or csv.
Manager Name - Department
Direct Report 1
Direct Report 2
(Need something here to separate to make it visually obvious there is a new manager, a simple newline or character to break it up would work fine.)
Manager Name 2 - Department
Direct Report 1
Direct Report 2
I’ve got a basic script working but I’m having trouble with two things.
- I only want the managers name and direct reports name. I’m getting a lot of extra information that’s making it hard to read.(things like OUs,O, DC, etc.)
- I don’t have any space between direct reports and managers so it’s hard to tell who is a manager or a direct report.
Here is the script i’m using
get-aduser -Properties directreports -filter * | ?{$_.directreports.count -ne 0} | select name, directreports | sort name | ft |export-csv h:\orgChart.csv
I’m also getting a lot of string errors “-ne” is not recognized even though it still seems to work.
Any suggestions for spacing between managers and removing all the OUs for a cleaner output?
Thank you!
-Chris Blum