Skip to content

Instantly share code, notes, and snippets.

@futureimperfect
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save futureimperfect/124c763ece3aca993da3 to your computer and use it in GitHub Desktop.
Save futureimperfect/124c763ece3aca993da3 to your computer and use it in GitHub Desktop.
Complex LDAP query with ldapsearch
ldapsearch -LLL -x -H ldap://ldap.example.com -b "ou=someou,dc=example,dc=com" '(&(nickname=M*)(employeeType=fulltime)(|(!(departmentNumber=5*))(loginShell=/bin/bash)))' mail | awk '/mail: / { print $2 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment