Solved

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

Posted on 2013-01-23
6
523 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:Don Coleman
[X]
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
6 Comments
 
LVL 55

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: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.
0
 
LVL 55

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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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.
0
 
LVL 55

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:Don Coleman
ID: 38812545
Ok thanks for the help
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

632 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