Late but full "copy/paste" answer (based on previous ones - thanks - I could have quit after writing ipa2json); for present and future needs.
export users with:
ipa user-find --all > ipa.txt
if the output is truncated adjust the limit with the command below and retry:
ipa config-mod --searchrecordslimit=######
if not yet installed, install nodejs (with nvm I suggest), eg:
wget https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bashnvm install --lts
install the required tools:
npm i -g ipa2jsonnpm i -g equalizejsonnpm i -g json2csv
convert ipa output to json with:
ipa2json ipa.txt > ipa.json
convert ipa output to json, equalize the json (you need all the fields in all the instances for proper csv conversion) and convert to csv :
ipa2json ipa.txt | equalizejson | json2csv > ipa.csv