Solved

Export AD users from perticular distribution group

Posted on 2010-08-25
6
465 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
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 500 total points
ID: 33522658
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

688 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