get list of enabled active directory users in excel format

I want to get list of enabled active directory users in excel format

My scenario:-
All user accounts are under 1 OU (Organisational Unit)  called USERS but there are sub  Organisational units (OU) with users based on the location.
itadminhelpAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mark GalvinManaging Director / Principal ConsultantCommented:
Hi

Do you have access to ADUC?
0
Mark GalvinManaging Director / Principal ConsultantCommented:
If you have access to ADUC you can setup a saved query. This is what I do:
Right click on Saved Queries
Setup a new Query - give it a name
Set the Query root to your OU
Under the Query Definitions select Custom then Advanced
Use this
(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
And click OK to all boxes
Right click on the query and select Refresh

That should give you a list of all the enabled users in that OU. You can then right click on the Query and export it.

You can find more infomation on the userAccountControl funtion here http://support.microsoft.com/kb/305144/en-us to do the opposite of any of the values just put a (! before the code and a ) after:
(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2)) lists all disabled users
(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))) lists all enabled users

Thanks
Mark/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
itadminhelpAuthor Commented:
Thanks Mark,

That worked for me. That query above gives me just heading with username, type and Description.
Is there a way i can get heading of Account status, Firstname and lastname ?
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Mark GalvinManaging Director / Principal ConsultantCommented:
Thats just the Columns you have showing in ADUC.

In the Window select View --> Add/Remove Columns

Thanks
Mark/
0
itadminhelpAuthor Commented:
Thanks Mark,

One last thing, I didn't find Account Status Tab (Which says whether account his enabled or disabled) . This is the information what auditor wants to see in the excel report. Is there a way i can get that column in the report?
0
Mark GalvinManaging Director / Principal ConsultantCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.

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.