Solved

Export AD users from perticular distribution group

Posted on 2010-08-25
6
459 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
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…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now