?
Solved

Export AD users from perticular distribution group

Posted on 2010-08-25
6
Medium Priority
?
466 Views
Last Modified: 2013-12-24
I am new to VB scripting and dont know even basics, could someone provide me VBscript which should export active directory users from perticular group with specific attributes into .csv or txt file. Thanks
0
Comment
Question by:tech2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33519262
type on server on workstation with Administrative Tools installed in command-line

dsquery group -name <group_name> | dsget group -members -expand | dsget user -fn -ln -samid -email -desc >c:\users.txt

It will export users from specified groups with First Name, Last Name, login, e-mail address (if specified) and description to C-drive onto users.txt file.
0
 

Author Comment

by:tech2010
ID: 33519280
the reason i want to do this via vbscript because i want to include some customized column in to output file. is there any sample or quick / easy script available?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 71

Expert Comment

by:Chris Dent
ID: 33519297

Hey there,

You could do far worse than pick up PowerShell for this one, if you get this:

http://support.microsoft.com/kb/968930

And this:

http://www.quest.com/powershell/activeroles-server.aspx

Then all you need run is:


Get-QADGroupMember "Your Group" | Select-Object Name, Description, Title | Export-Csv "SomeFile.csv" -NoTypeInformation


The Select-Object statement picks up the fields you might be interested in, if you need more, less or something entirely different then just yell.

Chris
0
 

Author Comment

by:tech2010
ID: 33522611
Is there any GUI tool available which generate vbscript on the basis of what options we specify in the tool?
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 2000 total points
ID: 33522658
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question