Solved

Domain users list

Posted on 2010-09-21
6
805 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
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

776 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