I played a bit and figured out this will work, if you need more help exporting let me know
Get-ADUser username -Properties Manager |foreach {
$manager = $_.Manager
do
{
$manager = Get-ADUser -Identity $manager -Properties Manager -ErrorAction
SilentlyContinue
$manager.name
$manager = $Manager.Manager
pause
}
#do this until there is no more manager
until ([string]::IsNullOrEmpty( $Manager))
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.