Dear Experts,
The following cmdlet gives out the name and manager details of all the direct reportees of a given manager 'manager1' . Could you please direct me how can we make it run
recursively so that it gives the details underneath it? Thanks.
Get-ADUser -Identity manager1 -Properties directreports | Select-Object -ExpandProperty DirectReports | Get-ADUser -Properties manager | select name, @{Name = 'Manager'; Expression = {(Get-ADUser $_.Manager).Name}}