I am trying to get a list of group members for multiple groups from active directory and export the list into csv file. I am getting names and SamAccountName with my script but I need users Email Addresses as well. If anyone can help me out that would be great. here is my script:
"l" and "e" are just shortened versions of "Label" and "Expression"
Get-ADUser $_ will get each user in the pipeline as they stream out from from your Get-ADGroupMember command. Then it's just a matter of selecting your desired properties, emailaddress in this instance.