Skip to content

Instantly share code, notes, and snippets.

View mfominov's full-sized avatar

Maksim Fominov mfominov

View GitHub Profile
@mfominov
mfominov / ldap2json.sh
Last active April 10, 2023 06:54 — forked from deardooley/ldap2json.sh
Parse output of ldapsearch to json
#!/usr/bin/env bash
# ldap2json.sh
#
# Example shell script showing how to parse LDIF output from the
# ldapsearch command into a json array. Please note that this
# script almost certainly does not handle every edge case, and
# is best used to pull a handful of fields a user or group
# record in a FreeIPA ldap server and format them as JSON for use
# in other tools.