Solved

Export AD users from perticular distribution group

Posted on 2010-08-25
6
462 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
6 Comments
 
LVL 5

Expert Comment

by:amdefacto
ID: 33519259
0
 
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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 70

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 70

Accepted Solution

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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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…

809 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