Freeipa Import Group Memberships

General Information

Parse a text file dump of 389 LDAP “unique members” and add the group memberships to a FreeIPA server.


  • FreeIPA server
  • Unique members LDAP dump


Place the text file “memberlist-uniqueentry.txt” in the same directory and execute


The Code

An example LDAP Unique member list output

# extended LDIF
# LDAPv3
# base <ou=groups,ou=MyOrg,dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: gidNumber uniquemember 
# users, Groups, Servers, MyOrg,
dn: cn=users,ou=Groups,ou=MyOrg,dc=example,dc=com
gidNumber: 100
uniquemember: uid=lskywalker,ou=Users,ou=MyOrg,dc=example,dc=com
uniquemember: uid=dvadar,ou=Users,ou=MyOrg,dc=example,dc=com
uniquemember: uid=yoda,ou=Users,ou=MyOrg,dc=example,dc=com
# developers, Groups, Servers, MyOrg,
dn: cn=developers,ou=Groups,ou=MyOrg,dc=example,dc=com
gidNumber: 103
uniquemember: uid=bert,ou=Users,ou=MyOrg,dc=example,dc=com
uniquemember: uid=ernie,ou=Users,ou=MyOrg,dc=example,dc=com
uniquemember: uid=oscar,ou=Users,ou=MyOrg,dc=example,dc=com
# operations, Groups, Servers, MyOrg,
dn: cn=operations,ou=Groups,ou=MyOrg,dc=example,dc=com
gidNumber: 777
uniquemember: uid=spock,ou=Users,ou=MyOrg,dc=example,dc=com
# web_devel, Groups, Servers, MyOrg,
dn: cn=web_devel,ou=Groups,ou=MyOrg,dc=example,dc=com
gidNumber: 18651
# search result
search: 2
result: 0 Success

  • python_wiki/freeipa_import_group_memberships.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)