Solved

Domain users list

Posted on 2010-09-21
6
832 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
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

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

630 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