• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

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

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
Don Coleman
Asked:
Don Coleman
  • 3
  • 3
1 Solution
 
McKnifeCommented:
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
 
Don ColemanOwnerAuthor Commented:
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
 
McKnifeCommented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
Don ColemanOwnerAuthor Commented:
I would prefer just one column I only need the username but 3 columns will work if not possible to do 1.
0
 
McKnifeCommented:
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
 
Don ColemanOwnerAuthor Commented:
Ok thanks for the help
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now