Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Active Directory / Advanced Search in Active Directory: Users, Computers, and Groups

August 3, 2026

Advanced Search in Active Directory: Users, Computers, and Groups

Active Directory provides several built-in tools for searching domain objects, including graphical management consoles, command-line tools, and PowerShell cmdlets. In this article, we’ll show you how to search for different types of Active Directory objects, including users, computers, groups, and Organizational Units (OUs), using both simple and advanced LDAP filters. You’ll also learn how to search by name using wildcards, patterns, and multiple search criteria.

Contents:
  • Search Active Directory Objects with Wildcards (ADUC)
  • Search Computer Objects in Active Directory
  • How to Search for Active Directory Objects Using PowerShell

The task of searching for objects in Active Directory (users, groups, or computers) by name using some pattern, regular expression, or wildcard is not as obvious as it seems.  By default, the Active Directory Users and Computers (ADUC) snap-in does not support using the standard asterisk (*) wildcard at the beginning or in the middle of a search phrase.

For example, suppose you want to find all Active Directory groups whose names contain the keyword “SQL”.  If you open the AD search console (Find User, Contacts, and Groups) in ADUC and perform a basic search for the sql keyword, the results may not be what you expect. By default, ADUC returns only users and groups whose names begin with the specified keyword. Objects whose names contain sql elsewhere in the string are not returned. Likewise, searching using the *SQL* query does not work. The ADUC search dialog does not interpret wildcard characters in the search field, so the asterisks are treated as literal characters rather than wildcard operators.

search active directory from ADUC console

  Users of Windows 10 and 11 can search the Active Directory directly from their computers, without having to install additional tools or snap-ins. To open the “Search Active Directory” graphical form in Windows 11, simply enter the following command:

rundll32.exe dsquery,OpenQueryWindow

Search in Aactive Directory from Windows 11 machine without installing ADUC

Search Active Directory Objects with Wildcards (ADUC)

To search for Active Directory objects matching a specific filter from the Active Directory Users and Computers (ADUC, dsa.msc) graphical console, you can use simple LDAP queries. These queries allow you to perform more flexible searches than the standard ADUC search dialog, including searches based on object attributes and partial matches.

  1. To do it, open the Find menu and select Custom Search in the dropdown list;
  2. Go to the Advanced tab;
  3. Type name=*sql* in the Enter LDAP query field.
Note. This LDAP query is used to search for all Active Directory (AD) objects containing the sql keyword in their name. To do this, insert the wildcard character * before and after the keyword.

If you only want to search for AD group objects, use the following LDAP query.

(&(objectcategory=group)(name=*sql*))

search Active Directory object using wildcard LDAP filter

As you can see, this LDAP query returned many AD object types, including groups, computers, users, and gMSA service accounts.

To search for AD objects of a specific type only, specify this in the objectcategory value. For example, if you only want to search for group objects in AD, use the following LDAP query.

(&(objectcategory=group)(name=*sql*))

You can use advanced filtering options in the Active Directory Search console. To do this, enable the Filter option in the View menu and use the advanced filters to refine your search.

advanced filtering in active directory search results

By selecting the View > Choose Columns menu option, you can add additional AD object attributes to filter the found objects by.

You can save frequently used search queries in the Saved Queries section of the ADUC snap-in so you don’t have to manually type the LDAP filters each time.

Saved search queries in Active Directorypng

Here is an example of a more complex LDAP query: find all users in AD whose email address is blank (not filled):

(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(!mail=*) )​​

More information about LDAP search filter syntax can be found in the documentation.

If you are using the Active Directory Administrative Center (dsac.exe) console to filter AD objects, LDAP queries can also be used for searches. Select Global Search and switch to Convert to LDAP mode. Enter your query in the LDAP query field.

global search in Active Directory Administrative Center

Search Computer Objects in Active Directory

To search for computer and server accounts in Active Directory using an exact match, select Computers from the Find drop-down list, then specify the name of the computer to search for.

active directory computer searching

If you need to find computers in AD using a wildcard, you can apply the following LDAP query in the Custom Search -> Advanced section of ADUC.

(&(objectcategory=computer)(name=*sql*))

How to Search for Active Directory Objects Using PowerShell

The PowerShell module for Active Directory can be used to search for objects in AD from the command prompt.  To search Active Directory for a particular type of object, use the appropriate cmdlet:

  • Get-ADGroup – search for groups
  • Get-ADUser – search for user accounts
  • Get-ADComputer – search for computer account objects

To search for groups in AD using a wildcard, use the following PowerShell command:

Get-ADGroup -Filter {name -like "*sql*"} -Properties Description,info | Select Name,samaccountname,Description,info | Sort Name

powershell search ad groups wildcard

Similarly, you can search by the username or the computer name. The examples of two such commands are given below. Additionally, in the second command, we specified multiple search criteria and restricted the search scope to a specific Organizational Unit (OU) by using the –SearchBase parameter.

Get-ADUser -Filter {name -like "*sql*"}
Get-ADComputer -Filter 'Name -like "*sql*" -and OperatingSystem -like "*Windows Server 2025*" -and Enabled -eq $true' -SearchBase "OU=DE,DC=woshub,DC=com"

If you don’t know exactly what type of object you’re looking for, you can run a general search across all Active Directory object types using the Get-ADObject cmdlet:

Get-ADObject -Filter {name -like "*sql*"} –Properties * | select sAMAccountName, ObjectClass, userPrincipalName, DisplayName, Description | FT

As you can see, the command returned all object classes in AD: computer, user, group, and msDS-GroupManagedServiceAccount objects.

Get-ADObject search in active directory objects

Search only among Contact objects in the domain:

Get-ADObject -Filter 'ObjectClass -eq "contact" -and Name -like "*sql*"'

You can use the LDAP filter directly in the Get-ADObject command

Get-ADObject -LdapFilter "(&(objectCategory=person)(objectClass=user)(cn=*sql*))"

The specialized Search-ADAccount cmdlet can be used to find disabled or inactive user and computer accounts.

To find all AD Group Managed Service Accounts (MSA and gMSA), use the command:

Get-ADServiceAccount -Filter {name -like "*sql*"}

To search by Organizational Unit name, use the following cmdlet:

Get-ADOrganizationalUnit -Filter "Name -like '*stations*'"

In some cases, when you cannot install this module on a workstation but still need to perform a search in AD (for example, in a PowerShell logon script that is run via GPO), you can use the following syntax:

$searchuser="*sql*"
([adsisearcher]"(&(objectCategory=person)(objectClass=user)(displayname=$searchuser))").FindAll() |
ForEach-Object { $_.Properties.displayname }

I hope these easy methods will make it easier for you to search for objects in Active Directory.

0 comment
9
Facebook Twitter Google + Pinterest
Active DirectoryPowerShell
previous post
Run a Script (Program) When a Specific Program Opens/Closes in Windows
next post
Checking Hard Drive Health (SMART) in Windows

Related Reading

How to Refresh (Update) Group Policy Settings on...

March 24, 2026

Configuring Windows Firewall Rules Using Group Policy

March 15, 2024

Repairing the Domain Trust Relationship Between Workstation and...

February 19, 2026

Checking Active Directory Domain Controller Health and Replication

May 15, 2025

Configuring Proxy Settings on Windows Using Group Policy...

February 27, 2023

Troubleshooting: Group Policy (GPO) Not Being Applied to...

March 15, 2024

Cached Domain Logon Credentials on Windows

July 29, 2025

How to Convert SID to User/Group Name and...

August 27, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Invalid Signature Detected: Check Secure Boot Policy [Fix]

    August 5, 2026
  • Windows Installer Service Could Not Be Accessed? How to Fix It

    July 28, 2026
  • Why Windows Reports No Internet Access: How Connectivity Detection Works

    July 26, 2026
  • Inactive TS Ports in Windows: Causes and Fixes

    July 20, 2026
  • Add Wireless Wi-Fi Profiles on Windows Devices via Export/Import or GPO

    July 13, 2026
  • CrowdSec on Windows: From Installation to Threat Blocking

    July 3, 2026
  • Manage Microsoft Store Apps with Store CLI in Windows 11 from Terminal

    July 2, 2026
  • Windows Sandbox on Windows 11: Enable, Configure, and Use

    June 10, 2026
  • How to Monitor Windows Machines with Zabbix

    May 26, 2026
  • Fixing Duplicate Security Identifier (SID) Issues in Windows

    May 25, 2026

Follow us

  • Facebook
  • Twitter
  • Youtube
  • Telegram
Popular Posts
  • Configure Google Chrome Settings with Group Policy
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • How to Disable or Enable USB Drives in Windows using Group Policy
  • How to Find the Source of Account Lockouts in Active Directory
  • Get-ADComputer: Find Computer Properties in Active Directory with PowerShell
  • Configuring Proxy Settings on Windows Using Group Policy Preferences
  • Adding Domain Users to Local Administrators in Windows
Footer Logo

@2014 - 2026 - Windows OS Hub. All about operating systems for sysadmins


Back To Top