Get all members from a group included nested groups?
Are there a way to get all members of a group included members from nested groups?
I can get members of a group just fine but it also include groups, but are there a way to easely get all members including those from the nested groups?
Something like what the -recursive flag does for get-adgroupmember in powershell?
No, I’m sorry. This is something specific to AD. You have to recurse the response by yourself in your code.Bye,GiovanniIl giorno 29 ott 2022, alle ore 19:32, madsholme @.***> ha scritto: Are there a way to get all members of a group included members from nested groups? I can get members of a group just fine but it also include groups, but are there a way to easely get all members including those from the nested groups? Something like what the -recursive flag does for get-adgroupmember in powershell?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Fair enought, thanks for the fast answer
@madsholme Did you try using LDAP_MATCHING_RULE_IN_CHAIN? Like:
ldap_base = "DC=example,DC=com"
ldap_filter = f"(&(objectclass=user)(objectcategory=person)(memberof:1.2.840.113556.1.4.1941:=CN=Domain admins,CN=Users,{ldap_base}))"
conn.search(search_base=ldap_base, search_filter=ldap_filter, search_scope="SUBTREE")
@markkrj Hey thanks for this, this seems to be what i was missing!