List AD group members

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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
 

TheShooter93

Cody
Malware Specialist
Joined
Jul 9, 2008
Messages
11,250
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.
 

night-fury

Thread Starter
Joined
Nov 27, 2014
Messages
89
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.
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.
 

peterh40

Peter
Joined
Apr 15, 2007
Messages
1,478
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
 

night-fury

Thread Starter
Joined
Nov 27, 2014
Messages
89
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
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]
 

Triple6

Rob
Moderator
Joined
Dec 26, 2002
Messages
52,933
You need to use quotes around them if there is a space in the OU.
 

night-fury

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


Get-ADGroupMember : Cannot convert 'System.Object[]' to the type 'Microsoft.ActiveDirectory.Management.ADGroup'
required by parameter 'Identity'. Specified method is not supported.
At line:1 char:19
+ Get-ADGroupMember cn=myGroup,ou=myOU,DC=123,DC=abc,DC=com
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: :)) [Get-ADGroupMember], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.ActiveDirectory.Management.Commands.GetADGroupMember
I, however, got an output with the below command:

Get-ADGroupMember "MyGroup" | Where { $_.objectClass -eq "user" }
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" }
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top