King0770-Notes-ldapsearch-to-csv

Revision as of 22:20, 24 May 2016 by King0770 (talk | contribs) (Created page with "==<strong>Purpose</strong>== === '''Quick''' and '''dirty''' command to convert ldapsearch output to csv output. === <code><pre> ldapsearch -LLL -x -h `zmhostname`:389 -D $...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Purpose

Quick and dirty command to convert ldapsearch output to csv output.

ldapsearch -LLL -x -h `zmhostname`:389 -D $zimbra_ldap_userdn -w $zimbra_ldap_password '(&(zimbraAccountStatus=active)(&(!(zimbraIsSystemResource=TRUE))(!(zimbraIsSystemAccount=TRUE))))' cn sn displayName mail | sed -n '1h; 2,$H;${g;s/\n/,/g;p}' | sed 's/,,/\n/g'

Jump to: navigation, search