For the past few days i have been trying to get specific properties (Name, Title, etc.) from an ADSI search of someones direct reports with no luck. Here is my current code:
$searcher = [adsisearcher]"(samaccountname=$user)"
$DirectReports = $searcher.FindAll().Properties.directreports
So far, i have tried
$searcher = [adsisearcher]"(samaccountname=$user)"
$dr = [adsi]('LDAP://' + $searcher.FindAll().Properties.directreports)
$drfinal = $dr.name
This returns nothing of course since was just trying to grab a name, so i am not sure how to narrow it down, any help would be appreciated. Thanks!