Open naloqab opened 6 years ago
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)
This is what I get:
Traceback (most recent call last): File ".\ldap_test2.py", line 7, in
q = adquery.ADQuery()
File "C:\Program Files (x86)\Python\Python36-32\lib\site-packages\pyad\adquery.py", line 39, in init
self.__adodb_conn.Open("Provider=ADSDSOObject")
File "", line 3, in Open
File "C:\Program Files (x86)\Python\Python36-32\lib\site-packages\win32com\client\dynamic.py", line 287, in ApplyTypes
result = self.oleobj.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB Service Components', 'The parameter is incorrect.', None, 0, -2147024809), None)