Find user’s Managers Name from AD

How to retrieve user’s manager name using active directory powershell module

Requirements:

The machine needs to have installed Active Directory Module or install RSAT Tools .

$managers = Get-Content -Path "source path"
$users = foreach ($x in $managers){
   
    get-aduser -filter {EmailAddress -eq $x}  -Properties manager,organization |
select name,@{n='Manager';e={(Get-aduser $_.manager).name}} 

   
}

 

Exit mobile version