# Query LDAP

If you need to query raw ldap values you can use the query option together with filters. The returned values are not parsed in any way and should return the exact same output as ldapsearch or similar tools.

```bash
nxc ldap <ip> -u username -p password --query "(sAMAccountName=Administrator)" ""
nxc ldap <ip> -u username -p password --query "(sAMAccountName=Administrator)" "sAMAccountName objectClass pwdLastSet"
```

<figure><img src="https://361548579-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0qbsNvsXjRTsQcNipGM%2Fuploads%2Fgit-blob-76c19a3901ca3d5477a1c25fe091beb07a4da026%2Fimage.png?alt=media" alt=""><figcaption><p>Querying ldap with NetExec</p></figcaption></figure>
