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

Advertisements

Blog at WordPress.com.

Up ↑

%d bloggers like this: