Solved

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

Posted on 2013-01-23
6
492 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
  • 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: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 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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

895 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

14 Experts available now in Live!

Get 1:1 Help Now