Find active users in Active Directory

Hey guys,

I am trying to generate a report that shows the current users in Active Directory. How can i do this?
LVL 4
Cobra25Asked:
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.

stevegarriCommented:
If you are familiar with Powershell you could use this handy script to generate Excel based reports: https://gallery.technet.microsoft.com/scriptcenter/Generate-Excel-report-48c3f3b4#content
0
Steve WhitcherSystems AdministratorCommented:
If you want user accounts that are not disabled, you could use powershell:

get-aduser | where {$_.enabled -eq $true} 

Open in new window

0
Cobra25Author Commented:
Unfortunately, im not good with powershell lol.
0
Problems using Powershell and Active Directory?

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

Steve WhitcherSystems AdministratorCommented:
The one line script I provided should give you what you want.  just open powershell on your DC and paste that in.  Or, even better, add the command to export the data to CSV file automatically.

get-aduser | where {$_.enabled -eq $true} | export-csv $env:homepath

Open in new window


That should create a csv file in the c:\users\%username% folder.
0
NVITCommented:
How detailed a report? If you just want the usernames, then...
net users /domain

Open in new window

0
Cobra25Author Commented:
Steve, i get an error message saying "the term 'get-aduser' is not recognized"
0
stevegarriCommented:
I found this, maybe this would help: http://cjwdev.co.uk/Software/ADReportingTool/Info.html
0
stevegarriCommented:
Make sure you are in powershell. If you are in command prompt type in powershell. Put that script in a directory you can remember and run from Powershell
0
Steve WhitcherSystems AdministratorCommented:
You need to run that in powershell on a domain controller.  Depending on the OS and powershell version, you might also have to import the module first:

import-module activedirectory
get-aduser -filter *| where {$_.enabled -eq $true} | export-csv $env:homepath

Open in new window

0
Cobra25Author Commented:
Steve, i am logged into a DC as domain admin and the export to the c:\users\ path is denied.

I ran powershell as admin
0
stevegarriCommented:
You'll need to export to the user folder you are logged in as. Change your -Path to c:\users\(your logged in user\desktop or something of the sorts
0
Cobra25Author Commented:
stevegarri, do you have the script for that?
0
stevegarriCommented:
Unfortunately not, try that other free tool I posted above. It may be easier for you to use
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
dsquery user -inactive x (where x is a number of weeks since they were last active)

More information here:
http://ss64.com/nt/dsquery-user.html
0
Lee W, MVPTechnology and Business Process AdvisorCommented:
NOTE: DSQUERY is a command line tool - run it in a simple command prompt on your domain controller.
0
Will SzymkowskiSenior Solution ArchitectCommented:
What is so hard about this?

Import-module activedirectory
Get-ADuser -Filter * -Properties Name, sAMAccountName, Enabled | select Name, sAMAccountName, Enabled | Export-csv "c:\aduserexport.csv" -NoTypeInformation

Open in new window


You do not need to run this from the Domain Controller. You can run it from your workstation. However, you will require RSAT (Remote Server Admin Tools) to be installed on your machine first.

The script above will export all of your AD users to a CSV showing Name, sAMAccountName and if the account is Enabled.

Will.
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
Alan MichaelCommented:
I found really good information related to this topic from https://technet.microsoft.com/en-us/library/ee617195.aspx
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
Active Directory

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.