Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2013-01-23
Medium Priority
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.
Question by:Don Coleman
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
  • 3
  • 3
LVL 56

Expert Comment

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.

Author Comment

by:Don Coleman
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.
LVL 56

Expert Comment

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.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

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

Accepted Solution

McKnife earned 2000 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.

Author Comment

by:Don Coleman
ID: 38812545
Ok thanks for the help

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

715 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