Results 1 to 4 of 4

Thread: Export users in a security/distribution list to txt file?

  1. #1
    Join Date
    Feb 2006
    Posts
    331

    Export users in a security/distribution list to txt file?

    Can anyone tell me how do I export users a list of the users in an AD security group or distribution list to a txt file? Thanks for any information.

  2. #2
    Join Date
    Nov 2005
    Posts
    709

    RE: Export users in a security/distribution list to txt file?

    There is a VBScript that you can get from here - http://www.microsoft.com/technet/scr...4/hey1122.mspx

    Or else, you can try to do the below:
    dsquery group -name XXX > groups.txt
    for /f "tokens=*" %%g in (groups.txt) do @echo %%g >>membership.txt && echo
    Members: >>membership.txt && dsget group %%g -members -expand
    membership.txt && echo ********************* >>membership.txt

  3. #3
    Join Date
    Jun 2006
    Posts
    623
    You can try to open at a command prompt and type the following: net group <groupname> > report.txt

    There is another way using csvde at a command prompt and type the below:

    csvde -f report.txt -r (sAMAccountName=<groupname>) -l member

    After that you can use VBScript when you have the Distinguished Name of the group:

    Set objGroup = GetObject("LDAP://cn=TestGroup,ou=West,dc=MyDomain,dc=com")
    For Each objMember in objGroup.Members
    Wscript.Echo objMember.Name
    Next

  4. #4
    Join Date
    Sep 2008
    Posts
    1
    does anyone have sample script to list all the users from three OU in Active Directory ?

    OU1, OU2, OU3 and export into txt file ?

    Thanks in Advance

Similar Threads

  1. Replies: 3
    Last Post: 17-04-2009, 06:12 PM
  2. Batch file to list directories, export to CSV
    By chickenfriedsteak in forum Windows Server Help
    Replies: 1
    Last Post: 16-02-2009, 08:35 PM
  3. Help :-( Export list of users
    By PureNectar in forum Active Directory
    Replies: 4
    Last Post: 06-12-2007, 07:00 PM
  4. Distribution List Members Export
    By BuvDeep in forum Active Directory
    Replies: 3
    Last Post: 02-05-2006, 07:52 AM
  5. Replies: 1
    Last Post: 10-06-2005, 07:52 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,885,537.56033 seconds with 17 queries