0
私はldap3ライブラリが新しく、55.000のuidのためにldapを検索してメール属性を取得する必要がある関数を構築しようとしています。ここでpython ldap3大容量のldap検索のための関数
は、それがどのように見えるかです:
def ldapsearch(i):
server = Server('myserverurl:389')
try:
with Connection(server) as conn:
conn.search('ou=people,dc=xxx,dc=fr', '(&(objectclass=person)(uid='+i+'))', attributes=['mail', 'cn', 'uid'])
entry = conn.entries[0]
except:
return'error search operation'
else:
if (len(entry)!=0):
return entry['mail']
else:
return'error uid not found'
しかし、私はそれは...任意のアイデアを働いて得ることができませんか?あなたの助けを事前に
Thxを、 ニコラス