Solved

Domain users list

Posted on 2010-09-21
6
826 Views
Last Modified: 2012-05-10
I need to print a list of all domain users in AD can someone help me do this?

Thank You.
0
Comment
Question by:narce100
[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
6 Comments
 
LVL 4

Expert Comment

by:rstjean
ID: 33731303
download http://download.sysinternals.com/Files/AdExplorer.zip

Then there is a work around to export the list

To quote "auteri" here http://forum.sysinternals.com/active-directory-explorer_topic22035_post116397.html

I found a way to use and export the AD Explorer query to text.

1. Create a query in ADExplorer
2. Copy ADExplorer query string (Just Under Value field)
3. Open Active Directory users and computers (dsa.msc)
4. Create new query under "Saved Queries"
5. Choose Define Query > Find "Custom Search" > Advanced Tab
6. Enter LDAP Query > Paste ADExplorer query string
7. Save query
8. Export with: Export List

Its a workable solution altough having a export button in ADExplorer would be better.
Mark, if you read this, please put export in there with a xml or csv version (or even better both).
0
 
LVL 14

Expert Comment

by:athomsfere
ID: 33731310
I would say dstools would be the easiest, below is a rough command to do it, but it would be a batch file to copy users samid, lastname and firstname to a txt file.

dsquery user "cn=users,ou=users,dc=company" | dsget user -samid -ln -fn >> users.txt
0
 
LVL 57

Accepted Solution

by:
Mike Kline earned 500 total points
ID: 33731471
I helped with a similar question yesterday, in my example I used adfind    

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_26487114.html

Thanks

Mike
0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 11

Expert Comment

by:farjadarshad
ID: 33731714
you can do this by following command

NET USERS /DOMAIN >c:\user.txt (the command generate a text file on root of c: with required information)

NET ACCOUNTS /DOMAIN>c:\account.txt (for domain accounts)

NET config server /DOMAIN>c:\server.txt (for domain servers)
0
 
LVL 5

Expert Comment

by:balmasri
ID: 33742929
Try this following scripts:
Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "User Name"

objExcel.Cells(1, 2).Value = "Full Name"

objExcel.Cells(1, 3).Value = "Description"

 

strDomain = InputBox ("Enter Domain Name")

Set DomObj = GetObject("WinNT://" & strDomain ) 

DomObj.Filter = Array("User") 

For Each objUser In DomObj 

objExcel.Cells(intRow, 1).Value = objUser.Name

objExcel.Cells(intRow, 2).Value = objUser.FullName

objExcel.Cells(intRow, 3).Value = objUser.Description

intRow = intRow + 1

Next 

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

Open in new window

0
 

Author Closing Comment

by:narce100
ID: 33761727
I followed the link and did some modifications and after testing a few times I got what I wanted
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

734 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