• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4813
  • Last Modified:

How to list all AD users and display account status Enabled / Disable on 1 list?

Our auditors are asking for a list of AD users listed on a single printout along with their current account status - Enabled or Disable.  We have our current users created in their respective dept OU's.  How can I get all of them on one listing?
1 Solution
Load Powershell, Then get and install Quest's ActiveRoles for Management Shell For Active Directory.
Then run Powershell and type the following command.

#For a list of enabled users
get-qaduser -Sizelimit 0 -Enabled

#For a list of Disabled Users
get-qaduser -Sizelimit 0 -Disabled
You may also export this to a csv using:

get-qaduser -Sizelimit 0 -Enabled | Export-Csv -path mycsv.csv

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Joseph DalyCommented:
Use the following at a command prompt.
dsquery user -samid * | dsget user -samid -ln -fn -disabled

The -disabled command displays the status of the accounts. A value yes returned establishes that the account is disabled (for logon); a value of no establishes that the account is enabled (for logon)

You can then pipe this to anything.txt
helpdesk_wlkAuthor Commented:
Who whoooo!  That's what I'm talkin about...   Fast, easy, no cost and I got the report to the auditors on time!  You are da man!
Joseph DalyCommented:
one other thing you may need to do is add the -limit 0 switch if you have more than 100 users.

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

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