Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

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.
0
itadminhelp
Asked:
itadminhelp
  • 4
  • 2
1 Solution
 
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
 
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now