1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

List AD group members

Discussion in 'Windows Server' started by night-fury, Mar 10, 2015.

Thread Status:
Not open for further replies.
Advertisement
  1. night-fury

    night-fury Thread Starter

    Joined:
    Nov 27, 2014
    Messages:
    89
    Hi,

    Can anyone help me how to get the list of members of an AD group in csv or excel etc. I don't understand, this being a very basic feature, why don't Microsoft introduce it by default.

    -regards,
    NF
     
  2. TheShooter93

    TheShooter93 Malware Specialist

    Joined:
    Jul 9, 2008
    Messages:
    11,245
    First Name:
    Cody
    Hi night-fury,

    This feature is built-in to Windows Server.

    Right-click the Group you want to export a list of and choose Export.

    You can save the list as tab-delimited or CSV.
     
  3. night-fury

    night-fury Thread Starter

    Joined:
    Nov 27, 2014
    Messages:
    89
    Apologies, I wasn't clear enough. I can right click on the OU and it gives me the option to export. But I want to get the list of group members of a distribution group (distribution list).

    I had this software earlier which used to pull the distribution groups from AD and was able to export the group members in excel file. It was called AD group members (its paid now), so since i was used to it, i wrote AD group instead of a DL/distribution group.
     
  4. valis

    valis Moderator

    Joined:
    Sep 24, 2004
    Messages:
    77,604
  5. TheShooter93

    TheShooter93 Malware Specialist

    Joined:
    Jul 9, 2008
    Messages:
    11,245
    First Name:
    Cody
    Gotta love Powershell. (y)
     
  6. peterh40

    peterh40

    Joined:
    Apr 15, 2007
    Messages:
    1,438
    First Name:
    Peter
    You can use Powershell commands to get list of group members:
    e.g.

    Import-module ActiveDirectory
    Get-ADGroupMember -Identity cn=MyGroup,ou=MyOU,dc=mycompany,dc=com
     
  7. night-fury

    night-fury Thread Starter

    Joined:
    Nov 27, 2014
    Messages:
    89
    i am getting an error, probably doin smthin wrong !

    my AD structure is like this:
    domain: abc.123.com
    ou: my OU (there is a space in the two words, would that be a problem?)
    distribution group: [email protected]
     
  8. Triple6

    Triple6 Moderator

    Joined:
    Dec 26, 2002
    Messages:
    52,935
    First Name:
    Rob
    You need to use quotes around them if there is a space in the OU.
     
  9. night-fury

    night-fury Thread Starter

    Joined:
    Nov 27, 2014
    Messages:
    89
    I did try with and without quotes but getting an error:


    I, however, got an output with the below command:

    It includes quite a few lines for each user. Is it possible to get only the names with either:

    Import-module ActiveDirectory
    Get-ADGroupMember -Identity cn=MyGroup,ou=MyOU,dc=mycompany,dc=com

    (if this works)

    OR

    Get-ADGroupMember "MyGroup" | Where { $_.objectClass -eq "user" }
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1144508

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice