Created
May 15, 2016 19:34
-
-
Save benbek/e8f29d3eb355a60c8e09becd596e9f0d to your computer and use it in GitHub Desktop.
Get a formatted list of all employees from LDAP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sort people by username (column 2) alphabetically | |
ldapsearch -H ldap://ldap.SERVER.com -x -b dc=__DOMAIN__,dc=com | grep ^# | sed -e 's/#//' -e 's/,//g' -e 's/ __DOMAIN__.com//' -e 's/ People//' | sort -k 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment