ops@toolbox:~$ dsquery * -filter

AD LDAP Query Builder

Build complex Active Directory search filters visually. Ideal for PowerShell `Get-ADUser`, RSAT GUI searches, dsquery, and LDAP integrations.

📂 1. Object Category / Class

⚙ 2. Account & Password status

✏ 3. Common Attributes

LDAP Search Filter

(&(objectCategory=person)(objectClass=user))

PowerShell CLI Usage Example

Get-ADObject -LDAPFilter '(&(objectCategory=person)(objectClass=user))'

Understanding AD LDAP Bitmasks

Active Directory stores many account status flags inside a single integer attribute called userAccountControl (UAC). To filter by these flags in LDAP, you cannot use simple equals signs; you must perform a bitwise AND operation. LDAP achieves this using two special matching rule OIDs:

For example, to find disabled accounts, we look for flag value 2 (ADS_UF_ACCOUNTDISABLE). The LDAP filter is:
(userAccountControl:1.2.840.113556.1.4.803:=2)

Recursive Group Membership (LDAP Chain Rule)

By default, querying (memberOf=CN=MyGroup,...) only returns direct members of that group. If "MyGroup" contains other groups, their members are excluded. Active Directory supports a special OID 1.2.840.113556.1.4.1941 (LDAP_MATCHING_RULE_IN_CHAIN) which performs a recursive search of the group hierarchy. Example:
(memberOf:1.2.840.113556.1.4.1941:=CN=MyGroup,...)

Related tools

Password Generator
Generate secure random passwords client-side.
htpasswd Generator
Create basic auth entries for Apache/nginx.
String Escape / Unescape
Escape strings for LDAP, shell, JSON or regex.