# LDAP

#### LDAP

```bash
# the query below will return active users (by sAMAccountName / username) in the  domain.

ldapsearch -x -h 10.10.10.100 -p 389 -D 'SVC_TGS' -w 'pass' -b "dc=domain,dc=com" -s sub"(&(objectCategory=person)(objectClass=user)(!(useraccountcontrol:1.2.840.113556.1.4.803:=2)))" samaccountname | grep sAMAccountName
```
