I'd like to use AD to maintain a list of a user's subordinates, which will be used in a custom application to control the display of information. Currently, this list is manually maintained, and it would be a lot easier if we could rely on AD for this.
Is there a way to recursively select all users and all of their subordinates (direct reports as well as direct report of direct reports) from Active Directory using PowerShell (or something else)?
The example org structure is:
1. President 2. VP 1 3. Team Member 1 3. Team Member 2 2. VP 2 3. Team Member 3 3. Team Member 4
I would like to get a csv file that contains the username of the manager and the username of their subordinates. In this example:
MANAGER,SUBORDINATE president, vp1 president, team1 president, team2 president, vp2 president, team3 president, team4 vp1, team1 vp1, team2 vp2, team3 vp2, team4The levels of nesting can obviously vary, but I'd like it to go as deep as it need to in order to capture all levels and provide the output.