Listing Users that Members of Specific Group in Active Directory

If you need a list contains users in a group in Active Directory, you can run two commands in CMD.

I will list domain admins and result will be created in C drive.

First query is

ldifde -f groupMembers.txt -r “(&(objectClass=User)(memberOf=CN=domain admins,cn=users,DC=sonat,DC=int))” -l “sAMAccountName,givenName,sn”

LDIFDE helps to find objects, printers, users etc… in Active Directory. All these objects are identified with *ObjectClass=object_class_name (either printer or user or OU).

Second query is (run this in Domain Controller)

net group “domain admins” >c:report.txt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: