Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以使用python ldap3连接到eDirectory?_Python_Active Directory_Ldap_Edirectory - Fatal编程技术网

是否可以使用python ldap3连接到eDirectory?

是否可以使用python ldap3连接到eDirectory?,python,active-directory,ldap,edirectory,Python,Active Directory,Ldap,Edirectory,我正在尝试使用python连接到eDirectory。这不像使用python连接到active directory那么容易,所以我想知道这是否可能。我目前正在运行python3.4,我是ldap3的作者,我使用eDirectory测试库 请尝试以下代码: from ldap3 import Server, Connection, ALL, SUBTREE server = Server('your_server_name', get_info=ALL) # don't user get_inf

我正在尝试使用python连接到eDirectory。这不像使用python连接到active directory那么容易,所以我想知道这是否可能。我目前正在运行python3.4,我是ldap3的作者,我使用eDirectory测试库

请尝试以下代码:

from ldap3 import Server, Connection, ALL, SUBTREE
server = Server('your_server_name', get_info=ALL)  # don't user get_info if you don't need info on the server and the schema
connection = Connection(server, 'your_user_name_dn', 'your_password')
connection.bind()
if connection.search('your_search_base','(objectClass=*)', SUBTREE, attributes = ['cn', 'objectClass', 'your_attribute'])
    for entry in connection.entries:
        print(entry.entry_get_dn())
        print(entry.cn, entry.objectClass, entry.your_attribute)
connection.unbind()
如果需要安全连接,只需将服务器定义更改为:

server = Server('your_server_name', get_info=ALL, use_tls=True)  # default tls configuration on port 636
此外,文档中的任何示例都应与eDirectory配合使用

再见,
乔瓦尼确信这是可能的。你试过什么?