ldap.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:gallery 作者: liam-middlebrook 项目源码 文件源码
def ldap_get_members():
    con = ldap.get_con()

    res = con.search_s(
            "ou=Users,dc=csh,dc=rit,dc=edu",
            pyldap.SCOPE_SUBTREE,
            "(memberof=cn=member,ou=groups,dc=csh,dc=rit,dc=edu)",
            ["entryUUID", "displayName"])

    members = [{
        "name": m[1]['displayName'][0].decode('utf-8'),
        "uuid": m[1]['entryUUID'][0].decode('utf-8')
        } for m in res]

    return members
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号