pyad
pyad copied to clipboard
Can you use pyad.set_defaults with adquery.ADQuery()? If not, what is the correct way to query Active Directory remotely?
This is what I get:
Traceback (most recent call last):
File ".\ldap_test2.py", line 7, in
having this issue myself
Try as following (via [ https://zakird.com/pyad/pyad.html ])
from pyad import *
pyad.set_defaults(ldap_server="dc1.domain.com", username="service_account", password="mypassword")
user = pyad.aduser.ADUser.from_cn("myuser"
```)
ADQuery object, not ADUser object.
There is the fix https://github.com/zakird/pyad/issues/49 , you should replace in adquery.py new version does not implement it (maintanence stopped)