How do I output members of a Security Group or OU to a text file


G

Guest

Hi there

I would like to be able to output the members of a particular OU or Security
Group to a text file. Are there any command line tools in the reskit or
elsewhere that will enable me to do this ?

Any help is much appreciated
 
Ad

Advertisements

C

Chriss3 [MVP]

This can be one way to script it out.

Set objGroup = GetObject _
("LDAP://cn=Users,cn=bultin,dc=fabrikam,dc=com")
For each objMember in objGroup.Members
Wscript.Echo objMember.Name
Next


--
Regards
Christoffer Andersson
Microsoft MVP - Directory Services

No email replies please - reply in the newsgroup
 
Ad

Advertisements

A

Andrew Mitchell

Chriss3 said:
This can be one way to script it out.

Set objGroup = GetObject _
("LDAP://cn=Users,cn=bultin,dc=fabrikam,dc=com")
For each objMember in objGroup.Members
Wscript.Echo objMember.Name
Next

One thing to be aware of is that most methods will not provide you with the
members of a group if the mebership has been gained via membership of another
group.

Eg. Group1 contains Group2
Group2 contains User1
Querying Group1 membership will not return User1 as a member, even
though they are (sort of....)

Andy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top