Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Rising Star

A quick easy way to export users from LDAP to a CSV for use in importing to Ambari.

ldapsearch -h ldapserver.mycompany.com -p 389 -D bind-user -w bind-password -b OU=London\ Users,OU=my\ dept,DC=mycompany,DC=com -s sub "(objectClass=user)" | grep sAMAccountName | sed 's/sAMAccountName://g' | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/'
1,004 Views