I'm not an experienced shell scripter, so I'm hoping for some expert help!
We use the following command in a for loop that cycles through UIDs:
ldapsearch -x -H ldaps://ldap-purple.example.com -b ou=People,dc=example,dc=com uid=jdoe
This command yields a record such as this:
# extended LDIF
#
# LDAPv3
# base <ou=People,dc=example,dc=com> with scope subtree
# filter: uid=jdoe
# requesting: ALL
#
# jdoe, people, example.com
dn: uid=jdoe,ou=people,dc=example,dc=com
cn: John Doe
homeDirectory: /afs/rats.example.com/users/t/jdoe
loginShell: /bin/bash
objectClass: posixAccount
uid: jdoe
uidNumber: 9239
gidNumber: 100002
# search result
search: 2
result: 0 Success
# numResponses: 2
# numEntries: 1
What I'd like to do is be able to grep or awk (or whatever) to then generate the 'cn','uid', and 'uidNumber' on the same row, I.e.
John Doe, jdoe, 9239
I'm not sure what tool can be used to create this, however.
Thanks in advance your your help!
Cheers, Dan