Skip to content
Snippets Groups Projects
Commit 44edf06b authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add intial script

parent bfb1f7cd
No related branches found
No related tags found
1 merge request!12Deltalogparse
#!/usr/bin/env python3
import lib_path
import lib
import ldap3
s = ldap3.Server('ldapi:///var/run/slapd/ldapi', get_info=[ldap3.ALL, ldap3.OFFLINE_SLAPD_2_4])
c = ldap3.Connection(s, authentication=ldap3.SASL, sasl_mechanism=ldap3.EXTERNAL, sasl_credentials='', auto_bind='NONE', version=3, client_strategy='SYNC')
c.bind()
search_base = 'cn=deltalog'
search_filter = '(objectClass=auditModify)'
search_scope = ldap3.SUBTREE
attributes = [ldap3.ALL_ATTRIBUTES, ldap3.ALL_OPERATIONAL_ATTRIBUTES]
r = c.search(search_base=search_base, search_filter=search_filter, search_scope=search_scope, attributes=attributes)
if r == True:
for entry in c.response:
print(entry['dn'], entry['attributes'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment