How can I export a list of all enabled users from active directory?

How can I export a list of enabled users from active directory to Excel?
wcgplcAsked:
Who is Participating?
 
Santosh GuptaConnect With a Mentor Commented:
Hi,


Create a new query, point the Query Root, click "Define Filter", select "Custom Search" from the drop down box, click Advanced tab and paste in the following LDAP filter


(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))

Open in new window

then right click on query and export the report.
0
 
wcgplcAuthor Commented:
Sorry friend but where do I create the query
1
 
Santosh GuptaCommented:
Hi,

open ADUC (run DSA.MSC) and then explore to saved query, right click on it and create new query.

http://thommck.wordpress.com/2011/03/04/using-saved-queries-to-filter-active-directory-users-and-computers/
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
wcgplcAuthor Commented:
Thanks friend that worked perfect.

Could you advise on a string to export all the disabled users
0
 
Santosh GuptaCommented:
Try this for disabled users.


(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))

Open in new window

0
 
wcgplcAuthor Commented:
yep that worked. Thank you!!
0
 
csditsCommented:
Hello,

I would be interested in this as well.   I got the disabled query to work but the enabled one doesn't for some reason.
Capture.JPG
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.