如何使用Python Pyad模块删除ADUser

时间:2018-07-10 05:35:52

标签: python python-2.7 pyad

我在删除ADUser时遇到问题。

pyad.set_defaults(ldap_server="dc1.domain.com", username="service_account", password="mypassword")

user = aduser.ADUser.from_dn("cn=myuser, ou=staff, dc=domain, dc=com")

user.delete()

不幸的是,我无法弄清楚如何设置此文本的格式以使其看起来像真实的回溯

    Traceback (most recent call last):
    File "C:/Automation/qa/robot2/python_lib/keywords/AD/unittest.py", line 34, 
    in <module>
    ad_connect.bg_ad_user_remove(user_login='vasya.oconnor@test-acme.com',dn_string= dn_string)
  File "C:\Automation\qa\robot2\python_lib\keywords\AD\_bg_ad_general.py", line 156, in bg_ad_user_remove
    user.delete()
  File "C:\Python27\lib\site-packages\pyad\adobject.py", line 537, in delete
    if not parent:
  File "C:\Python27\lib\site-packages\future\types\newobject.py", line 90, in __nonzero__
    return type(self).__len__(self)
AttributeError: type object 'ADContainer' has no attribute '__len__'

0 个答案:

没有答案