Share via


Powershell script for users in AD that Do not have managers

Question

Monday, May 30, 2016 6:51 PM

Hi,

I am new to powershell. I am trying to get the list of users in active directory that do not have managers with get Aduser.

Thanks,

jess370

All replies (1)

Monday, May 30, 2016 8:05 PM âś…Answered

Manager is an "extended property" of Get-ADUser.

Get-ADUser -Filter * -Properties manager | Select Name, Manager

You can bring back all of the extended properties using an asterisk:

Get-ADUser -Filter * -Properties *

To find the users without a manager:

Get-ADUser -Filter * -Properties manager | Where Manager -eq $null | Select Name

A list of the properties:

http://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx

Mike Smith TechTrainingNotes.blogspot.com
Books: SharePoint 2007 2010 Customization for the Site Owner, SharePoint 2010 Security for the Site Owner