Sep-17-2020, 12:56 PM
Hi everyone,
I'm trying to search inside Active Directory with PyAD but it's not clear...
I've tried this (from : https://zakird.github.io/pyad/pyad.html#...-directory)
But I would like to add more criteria the reduce the result.
I tried few thing including this last one ->
So I cannot feed where_clause a list :/
Any ideas ?
I'm trying to search inside Active Directory with PyAD but it's not clear...
I've tried this (from : https://zakird.github.io/pyad/pyad.html#...-directory)
from pyad import adquery q = adquery.ADQuery() q.execute_query( attributes = ["distinguishedName", "description"], where_clause = "objectClass = 'user'", base_dn = "CN=users, DC=Test, DC=internal" ) for row in q.get_results(): print(row["distinguishedName"])This give me a list.
But I would like to add more criteria the reduce the result.
I tried few thing including this last one ->
q.execute_query( attributes = ["distinguishedName", "description"], where_clause = ["objectClass = 'user'","CN = 'John*'"], base_dn = "CN=users, DC=Test, DC=internal" )But that give me also an error (TypeError: sequence item 2: expected str instance, list found)
So I cannot feed where_clause a list :/
Any ideas ?
![[Image: NfRQr9R.jpg]](https://i.imgur.com/NfRQr9R.jpg)