Exporting Active Directory Group to a Text File

  • Thread starter Thread starter wk
  • Start date Start date
W

wk

Hi
I would like to extract the login ids and names of
members in a group.

I know there is an export function for ou.
Is there also an export function for groups.

Can anyone tell me how?
 
This will list the group members in the domain admins group, edit it
accordingly to your needs and send the output to a file instead of the
screen if you want.

<snip>
Set rootDSE = GetObject("LDAP://rootDSE")
domainContainer = rootDSE.Get("DefaultNamingContext")

Set grp = GetObject("LDAP://CN=domain admins,CN=users," & domainContainer)
Set mList = grp.members
For Each member In mList
WScript.Echo member.Name
Next
<snip>

Regards,
/Jimmy
 
Off the top of my head...

you can run the command

net group GROUPNAME /domain

(make sure you actually type the word domain and not your
domain name)

Just pipe it out to a text file i.e.

net group GROUPNAME /domain > newfile.txt

Will only give you usernames though - not fuill names
 
Back
Top