hidden hit counter
Help!

Export AD Group Members to TXT File

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Active Directory RSS
Next:  printer  
Author Message
Marty2
External


Since: Apr 21, 2004
Posts: 13



PostPosted: Tue Sep 14, 2004 12:49 pm    Post subject: Export AD Group Members to TXT File
Archived from groups: microsoft>public>win2000>active_directory (more info?)

I am trying to find a way to export the members of a group
into a text file. The text file should only contain the
usernames, not the display or anything else.
Back to top
Tomasz Onyszko1
External


Since: Jul 23, 2004
Posts: 102



PostPosted: Tue Sep 14, 2004 3:26 pm    Post subject: Re: Export AD Group Members to TXT File [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Marty wrote:

 > I am trying to find a way to export the members of a group
 > into a text file. The text file should only contain the
 > usernames, not the display or anything else.

This will give you DN of each group member
===
strGroupDN = "CN=Group,OU=GroupOU,DC=domain,DC=local"
Set objGroup = GetObject("LDAP://" & strGroupDN)

arrMemberOf = objGroup.GetEx("member")

WScript.Echo "Members:"
For Each strMember in arrMemberOf
WScript.echo strMember
Next

Set objGroup = Nothing
===

if you want to get their samAccount name You can also do this with a script
==
Set objUser = GetObject("LDAP://" & strMember )
Wscript echo objUser.Get("samAccountName")
Set objGroup = Nothing
==

In such way You can get value all of user's attribute

--
Tomasz Onyszko [MVP]
T.Onyszko.RemoveThis@w2k.pl
<a style='text-decoration: underline;' href="http://www.w2k.pl" target="_blank">http://www.w2k.pl</a><!-- ~MESSAGE_AFTER~ -->
Back to top
GMusumeci



Joined: Jan 26, 2009
Posts: 1

Location: Washington DC area, USA

PostPosted: Mon Jan 26, 2009 11:18 am    Post subject: [Login to view extended thread Info.]

I develop a FREE tool to extract the List of Users from selected AD Groups and export results to a Excel file.

Check for AD Group Members in http://ctxadmtools.musumeci.com.ar
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Active Directory All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum