Created
July 16, 2019 16:54
-
-
Save krispayne/ea24941b1aa3bad89522b49ad4afd0f1 to your computer and use it in GitHub Desktop.
ldapsearch oneliner to find enabled users in a certain email domain (freeipa)
This file contains hidden or 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
ldapsearch -D "uid=kris,cn=users,cn=accounts,dc=domain,dc=net" -W -b "cn=users,cn=accounts,dc=domain,dc=net" '(&(mail=*@domain.com)(!(nsaccountlock=TRUE)))' displayname mail | grep -E "displayname|mail" | grep -v "#" | awk -F': ' '{print $2}' | sed 'N;s/\n/,/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment