zakird / pyad

Python Active Directory Tools | *Not actively maintained*
http://zakird.github.io/pyad/
176 stars 72 forks source link

pyad.pyadexceptions.win32Exception: 0x80070005: Access is denied. #65

Closed StarNeit closed 7 years ago

StarNeit commented 7 years ago

When I create a new object, I have below error message always.

pyad.pyadexceptions.win32Exception: 0x80070005: Access is denied.

I would like to know if it is pyad error or my AD sever configuration error.

Thank you.

(Code:) from pyad import * pyad.set_defaults(ldap_server="IT-LHQ-DC1.LIFEALIKE.LAB", username="administrator", password="password") ou = pyad.adcontainer.ADContainer.from_dn("ou=All_Users, dc=LIFEALIKE, dc=LAB") new_user = pyad.aduser.ADUser.create("test.02", ou, password="password")

(Result:) Traceback (most recent call last): File "E:\WEB_WORK\Python\test2\list.py", line 6, in new_user = pyad.aduser.ADUser.create("test.02", ou, password="password") File "C:\Python27\lib\site-packages\pyad\aduser.py", line 16, in create optional_attributes=optional_attributes File "C:\Python27\lib\site-packages\pyad\adcontainer.py", line 47, in create_u ser pyadutils.pass_up_com_exception(e) File "C:\Python27\lib\site-packages\pyad\pyadutils.py", line 58, in pass_up_co m_exception raise WIN32_ERRORS.get(info['error_num'], win32Exception)(error_info=info, a dditional_info=additional_info) pyad.pyadexceptions.win32Exception: 0x80070005: Access is denied.

zakird commented 7 years ago

This sounds like it's a permissions issue offhand not a pyad issue, but it's hard to tell from afar.

StarNeit commented 7 years ago

I have double checked the permission, but I have got write permission now. (I am able to read any information from AD with your pyad) So I really look forward to hearing good news from you again. Is there any solution now please?

By the way, can i use this pyad in Django project? If yes, how? Thank you for your help. I will star this project.

MLFSDATA commented 2 years ago

Was this ever solved? It looks like it was closed before any resolution.

I am experiencing the same issue now, and the AD account being used has all the necessary permissions.

rajsardhara commented 6 months ago

Incase anyone still having issue, This fixed issue: https://stackoverflow.com/questions/49632933/django-python-and-pyad