Return Active Directory User Accounts without a Manager

Hi there,

I was wondering if you could help, i'm looking to run a powershell script that returns all User accounts without a Manager using Get-ADUser. For some reason I can only return users with a manager.

Thanks so much!
TerellionAsked:
Who is Participating?
 
TerellionConnect With a Mentor Author Commented:
Actually i've finally found out how to just after posting!

Get-ADUser -SearchBase "ou=users,dc=domain,dc=local" -Filter * -Properties * | where {$_.manager -eq $null} | Select-Object  Name | Sort-Object Name
0
All Courses

From novice to tech pro — start learning today.