Solved

VB Script that pulls all Usernames from all OU's in Active Directory.

Posted on 2013-01-23
6
481 Views
Last Modified: 2013-01-23
Hello I am looking for a way to pull all users from all OU's in active directory and was wondering if anyone had a VBScript that they would be willing to share.  Any help would be appreciated thanks.
0
Comment
Question by:drcolema
  • 3
  • 3
6 Comments
 
LVL 53

Expert Comment

by:McKnife
ID: 38812237
The question will be "what should the output look like?".
A simple batch command "net user" will do when executed at a domain controller.
0
 

Author Comment

by:drcolema
ID: 38812284
Sorry meant to put that in the question I would like it to output to a txt or a csv file if possible thanks.
0
 
LVL 53

Expert Comment

by:McKnife
ID: 38812304
no, I mean, is the layout of the output of any importance?
See, for example
net user >%temp%\users.txt
 will produce a textfile with 3 columns.
0
 

Author Comment

by:drcolema
ID: 38812405
I would prefer just one column I only need the username but 3 columns will work if not possible to do 1.
0
 
LVL 53

Accepted Solution

by:
McKnife earned 500 total points
ID: 38812463
Well, I cannot figure out a script to get one column from net user, so take the command
dsquery user
that produces one column.
0
 

Author Comment

by:drcolema
ID: 38812545
Ok thanks for the help
0

Join & Write a Comment

Suggested Solutions

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

746 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

12 Experts available now in Live!

Get 1:1 Help Now