当我尝试使用此代码更新 Active Directory 属性时:
dn = (
"CN=user_ldap,OU=dept_name,OU=Application,"
"OU=Service Accounts,OU=Domain Users,DC=company-corp,DC=global"
)
# define the server
server = ldap3.Server(
"ldaps.company-corp.global", get_info=ldap3.ALL, port=636, use_ssl=True
)
# define the connection
conn = ldap3.Connection(server, dn, psw, auto_bind=True)
conn.start_tls()
userID = "jdoe"
# perform the Modify operation
conn.modify(
f"CN={userID},OU=managed,OU=Domain Users,DC=company-corp,DC=global",
{"displayName": [(ldap3.MODIFY_REPLACE, ["Doe, John D"])]},
)
print(conn.result)
我收到以下错误:
{'result': 32, 'description': 'noSuchObject', 'dn': 'OU=Managed,OU=Domain Users,DC=company-corp,DC=global', 'message': "0000208D: NameErr: DSID -03100241,问题 2001 (NO_OBJECT),数据 0,最佳匹配:\n\t'OU=Managed,OU=Domain Users,DC=ssnc-corp,DC=global'\n\x00", 'referrals':无,“类型”:“修改响应”}
请指教。
提前致谢。