Get Email addresses from members of an AD Group

Posted on 2012-08-14
1 Ratings
Last Modified: 2016-10-01
I am trying to find a vb/powershell script that will extract email addresses from members within an active directory group.

This group and it's members are not part of Exchange.

I know Get-AdGroupMember lists the members of the group but this does not give me their email addresses.

Any ideas?

thanks in advance
Question by:awgit
    LVL 5

    Accepted Solution

    If you install the free Quest PowerShell Tools ( , you can do this:

    get-qadgroup MyGroupName | get-qadgroupmember | select primarysmtpaddress

    Open in new window

    It will output only the email addresses. If you want their names as well, change the select statement to:

    get-qadgroup MyGroupName | get-qadgroupmember | select name,primarysmtpaddress

    Open in new window

    LVL 5

    Expert Comment

    You may also try piping the output of your Get-Adgroupmember output to " |select primarysmtpaddress" or "| select email"

    With that in mind, the Quest PowerShell tools are awesome and very handy.
    LVL 39

    Expert Comment

    by:Krzysztof Pytko
    Just pipe output to another cmd-let and select E-Mail parameter. Try this

    Get-ADGroup "GroupName" | Get-ADGroupMember -Recursive | Get-ADUser -Properties * | Select SamAccountName,GivenName,sn,Mail | Export-CSV c:\users.csv

    Open in new window


    Author Comment

    thanks this worked, except I had to replace primarysmtpaddress with email

    you rock!

    Expert Comment

    by:Sidry Rox
    Thanks a lot!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Why would I want to create a function for tracking messages? I am glad you asked. As with most monotonous/routine tasks, human error tends to creep in after doing the same task over and over again. By creating a function, you load the function once…
    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
    This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now