Business,  en,  general / allgemein

Active Directory Users and Computers wildcard search

For audits, etc. it is always useful to be able to „quickly“ pull out which users are really created in a particular stage.

You can use custom LDAP queries using wildcards for that.

So for instance if you want to find all users starting with „s“ and having the appendix „-f“ for a dedicated stage, you can perform the search within ADUC like that:

Wildcard-Search in ADUC

How to Find Active Directory Users or Groups with ADUC?

You can find the objects you need in the graphical ADUC console (dsa.msc) using simple LDAP queries.

  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=s*-f in the Enter LDAP query field.

Note. This LDAP query defines that you want to find all AD objects that contain sql keyword in their name. To do this, use the wildcard character * on both sides.

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

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

Searching AD Groups, Users, and Computers using Wildcards (woshub.com)

Quick-Search via Powershell

Get-ADUser -Filter 'Name -like "s*-f"' | Select-Object SamAccountName, DistinguishedName | ft
Get-ADUser -Filter 'Name -like "*sql*"' | Select-Object SamAccountName, DistinguishedName | ft