How to List Active Directory Users with ADUC

Last Update: Sep 30, 2024 | Published: Nov 07, 2022

Cloud Computing

SHARE ARTICLE

This article will offer you a straightforward way to list Active Directory users with Active Directory Users and Computers (ADUC). I’ll show you how to do that using the graphical user interface (GUI) with the ADUC tool.

Check out how to list Active Directory Users with PowerShell on Petri if you would prefer to perform this action programmatically.

How to list all users in Active Directory using the GUI

There are several methods you, as an IT pro, can use the Active Directory Users and Computers (ADUC) application to find all your user accounts in Active Directory. Let me first start with some simple searches to find user accounts.

The different ‘UserAccountControl‘ types

One important aspect to keep in mind is the dizzying number of ‘UserAccountControl‘ types. Here is a table that shows all the available types.

Property flagValue in hexadecimalValue in decimal
SCRIPT0x00011
ACCOUNTDISABLE0x00022
HOMEDIR_REQUIRED0x00088
LOCKOUT0x001016
PASSWD_NOTREQD0x002032
PASSWD_CANT_CHANGE

You can’t assign this permission by directly modifying the UserAccountControl attribute. For information about how to set the permission programmatically, see the Property flag descriptions section.
0x004064
ENCRYPTED_TEXT_PWD_ALLOWED0x0080128
TEMP_DUPLICATE_ACCOUNT0x0100256
NORMAL_ACCOUNT0x0200512
INTERDOMAIN_TRUST_ACCOUNT0x08002048
WORKSTATION_TRUST_ACCOUNT0x10004096
SERVER_TRUST_ACCOUNT0x20008192
DONT_EXPIRE_PASSWORD0x1000065536
MNS_LOGON_ACCOUNT0x20000131072
SMARTCARD_REQUIRED0x40000262144
TRUSTED_FOR_DELEGATION0x80000524288
NOT_DELEGATED0x1000001048576
USE_DES_KEY_ONLY0x2000002097152
DONT_REQ_PREAUTH0x4000004194304
PASSWORD_EXPIRED0x8000008388608
TRUSTED_TO_AUTH_FOR_DELEGATION0x100000016777216
PARTIAL_SECRETS_ACCOUNT0x0400000067108864
All the mind-numbing account types in Active Directory

As account attributes are modified, these values get assigned to the user account itself. You can use the adsiedit.msc snap-in if you want to view these. But, let’s do some searches now.

Searching for Active Directory user accounts in ADUC

  • Open Active Directory Users and Computers from Administrative Tools.
Active Directory Users and Computers (ADUC)
Active Directory Users and Computers (ADUC) – Image Credit (Petri.com/Michael Reinders)
  • Right-click on the domain root (reinders.local) and click Find…
Searching for new Active Directory user accounts
Searching for user accounts – Image Credit (Petri.com/Michael Reinders)
  • Click Find Now and then sort the ‘Type‘ column until ‘User‘ is displayed. You will then see all your true user accounts.
List Active Directory users
List Active Directory users – Image Credit (Petri.com/Michael Reinders)

Using the Saved Queries feature in ADUC

Next, let’s use the very helpful ‘Saved Queries‘ feature in ADUC:

  • Right-click on Saved Queries above your domain root object in the tree and click New -> Query.
  • Type in a Name and Description. Then, click Define Query…
Creating a New Query to find objects in Active Directory
Creating a New Query to find objects in Active Directory – Image Credit (Petri.com/Michael Reinders)
  • In the ‘Name:’ field, choose ‘Has a value.’
Defining a query for users
Defining a query for users – Image Credit (Petri.com/Michael Reinders)
  • Click OK and click OK a second time. Here is the result of our query definition.
Our always-accessible query for active users
Our always-accessible query for active users – Image Credit (Petri.com/Michael Reinders)

There we go! We’ve now created an always-accessible query for active users in our Active Directory.

Let’s use a different custom query.

  • Start another New Query. Choose a Name and Description, then click Define Query… again.
  • In the ‘Find:‘ box at the top, choose ‘Custom Search.’
  • Next, click the Advanced tab and enter this LDAP query:
(&(&(objectCategory=user)(userAccountControl=512)))
Defining a custom LDAP query for our search
Defining a custom LDAP query for our search – Image Credit (Petri.com/Michael Reinders)
  • Click OK twice and voila!
Our special '512' users
Our special ‘512’ users – Image Credit (Petri.com/Michael Reinders)

As you can see, only very ‘basic’ or vanilla users will be listed here. Only user accounts that have NO special attributes will be listed in this query.

Remember that table at the beginning of this article? If any account has any of those other attributes or states, they won’t show up here. It’s actually a nice tool to have.

Conclusion

I hope you found some nice nuggets of information here to assist you in discovering all your users in Active Directory. There are a lot of methods you can use, and each one has its own strengths and weaknesses. Finding the right balance especially when trying to hit a deadline from a security directive.

SHARE ARTICLE