Skip to content

Instantly share code, notes, and snippets.

@mastier
Created September 29, 2023 11:07
Show Gist options
  • Select an option

  • Save mastier/79b06540f721943f5b724a05e9667d2f to your computer and use it in GitHub Desktop.

Select an option

Save mastier/79b06540f721943f5b724a05e9667d2f to your computer and use it in GitHub Desktop.
ldapsearchbind.sh
ldapsearch -x -y ldap-password.txt -H ldaps://<server>:636 -D 'CN=....' -E 'pr=10000/noprompt' -b 'OU=....' -W '(&(objectClass=User)(memberOf=CN=))' sAMAccountName
# Remember that ldap-password.txt cannot have newline in the end, so use echo -n 'password' > ldap-password.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment