How can export all FreeIPA users to a csv file?

  • none that I know of, but quite simple to roll your own with some basic scripting. – natxo asenjo Jul 6 '18 at 20:07
  • 1
    indeed, two minutes with a shell in a host with the ipa-admin tools installed: ipa user-find | grep login | awk ' {print $NF}' | awk '{printf "%s,",$0} END {print ""}' and I get a comma separated listi of user names. Dumping this to a file and retrieving more than 100 records will be left as an exercise for the reader ;-) – natxo asenjo Jul 6 '18 at 20:17
  • but using Apache Directory Studio (a ldap browser) you can do just that, Select the part of the tree you need, and export it to csv, it works – natxo asenjo Jul 6 '18 at 20:42
  • @natxoasenjo Thanks for your update. I tried same way but I am missing something. I want show in like First Name, Last Name, Email, Mobile. format. – sanjayparmar Jul 8 '18 at 11:11
  • if you try with- ipa user-find --all | grep -E "First|Last|Email" you will get result like. First name: test1 Last name: test2 Email address: test21@ipa.example.com this need to be in CSV format – sanjayparmar Jul 8 '18 at 11:14

This command worked for me:

ipa user-find --all | grep -E "User Login|First|Last|UID|Email" > IPA_RAW.txt

after that, use this perl line to convert the format:

perl -ne 'chomp; print $_ . (($. % 8) ? "," : "\n")' IPA_RAW.txt | awk "Add your filters here" > users-list.csv


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.