How to export open directory into csv file?

Hi Support,


We are currently using mac server and we would like to export all of our users from this open AD. Is there any command line that we can use or tools to exports these users?.

null-OTHER, Other OS

Posted on Jul 5, 2017 12:38 AM

Reply
3 replies

Jul 10, 2017 7:01 PM in response to J35513tech

You might need to do a little extra work to get to a true csv, but you can use dsexport to output your OD account attributes to a flat file. For example, to dump everything:


sudo dsexport ~/Desktop/exportedUsers /LDAPv3/127.0.0.1 dsRecTypeStandard:Users


However, there are OD specific key/value pairs that you might not be interested in. You can use the -e and the key to exclude the value from the export. For example, a command I use quite frequent is:


dsexport ~/Desktop/exportedUsers /LDAPv3/127.0.0.1 dsRecTypeStandard:Users -e "dsAttrTypeStandard:AuthenticationAuthority" -e "dsAttrTypeStandard:Expire" -e "dsAttrTypeStandard:Change" -e "dsAttrTypeStandard:Password" -e "dsAttrTypeStandard:AltSecurityIdentities" -e "dsAttrTypeStandard:JPEGPhoto"


Please note that dsexport will not export passwords. However, if you are looking for an import file, you should likely be recreating password policy and entering them fresh.


Hope this helps,


Reid

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to export open directory into csv file?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.