Skip to content

Get group and its member details (mail, manager mail) with one execute_query  #141

Description

@kiranraj5223

`from pyad import adquery

query.execute_query(
attributes = ["cn","distinguishedName","member"],
where_clause = "objectClass = 'group' AND cn = 'US-*-ADMIN' AND NOT cn='VPN' AND NOT cn='SERVER'" ,
base_dn = "DC=domain,DC=com",
)

for row in query.get_results():
print(row["cn"]," - ",row["member"])
As output i am DN only for the member:US-ABCD-ADMIN - ('CN=test,OU=Users,OU=US,OU=Landlord US,OU=Corporate,DC=domain,DC=com',)`

Instead if DN i would like to have (mail, cn, samAccountName)

Any help is much appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions