List the Manager Emails for AD Group Members with PowerShell

Below is a quick script I’ve been working on for a colleague. Its simple purpose is to query an AD group then display each member’s username and the email address of their manager. Hopefully this will help others accomplish this common task with ease.

(Update 04/11/2018)

I modified the script to include the employee’s full name and also to sort the output by that name. Additionally, the way I was handling the variable members and naming bothered me. I knew it could be better. So I did some more research and cleaned that up utilizing the -ExpandProperty option for select.

 

Leave a Reply

Your email address will not be published. Required fields are marked *