• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 484
  • Last Modified:

Export AD users from perticular distribution group

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
1 Solution
Krzysztof PytkoSenior Active Directory EngineerCommented:
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.
tech2010Author Commented:
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?
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Chris DentPowerShell DeveloperCommented:

Hey there,

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


And this:


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.

tech2010Author Commented:
Is there any GUI tool available which generate vbscript on the basis of what options we specify in the tool?
Chris DentPowerShell DeveloperCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now